Skip to content

3769 Enhance logger logic of StatsHandler and DataStats#3774

Merged
wyli merged 17 commits into
Project-MONAI:devfrom
Nic-Ma:3769-add-log-level
Feb 8, 2022
Merged

3769 Enhance logger logic of StatsHandler and DataStats#3774
wyli merged 17 commits into
Project-MONAI:devfrom
Nic-Ma:3769-add-log-level

Conversation

@Nic-Ma

@Nic-Ma Nic-Ma commented Feb 7, 2022

Copy link
Copy Markdown
Contributor

Fixes #3769 .

Description

Thanks for the feedback in #3769 , this PR mainly:

  1. Added support to print log if the base log level is higher than INFO.
  2. Fixed the wrong logic of StatsHandler if name=None and addtional_handler, in the current code it will attach the additional handler to the system root logger.
  3. Fixed the duplicated print in DataStats if base log level is already INFO.
  4. Added warning message if using engine.logger and may not be able to print.
  5. Enhanced doc-string to explain the expected behavior.
  6. Removed unnecessary global logging setting in the unit tests.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Nic-Ma and others added 8 commits February 1, 2021 19:15
@Nic-Ma

Nic-Ma commented Feb 7, 2022

Copy link
Copy Markdown
Contributor Author

/black

@Nic-Ma

Nic-Ma commented Feb 7, 2022

Copy link
Copy Markdown
Contributor Author

/build

1 similar comment
@Nic-Ma

Nic-Ma commented Feb 7, 2022

Copy link
Copy Markdown
Contributor Author

/build

@Nic-Ma Nic-Ma requested review from ericspod, rijobro and wyli February 7, 2022 08:20
Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma

Nic-Ma commented Feb 7, 2022

Copy link
Copy Markdown
Contributor Author

/build

Comment thread monai/handlers/stats_handler.py Outdated
@Nic-Ma

Nic-Ma commented Feb 7, 2022

Copy link
Copy Markdown
Contributor Author

/build

@Nic-Ma Nic-Ma requested a review from wyli February 7, 2022 12:36
Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma

Nic-Ma commented Feb 7, 2022

Copy link
Copy Markdown
Contributor Author

/black

@Nic-Ma

Nic-Ma commented Feb 7, 2022

Copy link
Copy Markdown
Contributor Author

/build

Comment thread monai/handlers/stats_handler.py Outdated
Comment thread monai/handlers/stats_handler.py Outdated
Comment thread monai/transforms/utility/array.py
Signed-off-by: Nic Ma <nma@nvidia.com>
Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma

Nic-Ma commented Feb 7, 2022

Copy link
Copy Markdown
Contributor Author

/black

@Nic-Ma

Nic-Ma commented Feb 7, 2022

Copy link
Copy Markdown
Contributor Author

/build

@wyli wyli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this simplifies the logger handling, would be great to update the tutorials for the same refactoring.

@Nic-Ma

Nic-Ma commented Feb 8, 2022

Copy link
Copy Markdown
Contributor Author

/integration-test

@Nic-Ma

Nic-Ma commented Feb 8, 2022

Copy link
Copy Markdown
Contributor Author

Hi @wyli @ericspod ,

Thanks for your review.
I tested the PR with workflow integration test and some tutorial examples.
Also submitted a PR in tutorial to show the usage: Project-MONAI/tutorials#540.

Thanks.

Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma

Nic-Ma commented Feb 8, 2022

Copy link
Copy Markdown
Contributor Author

/black

@Nic-Ma

Nic-Ma commented Feb 8, 2022

Copy link
Copy Markdown
Contributor Author

/build

2 similar comments
@Nic-Ma

Nic-Ma commented Feb 8, 2022

Copy link
Copy Markdown
Contributor Author

/build

@wyli

wyli commented Feb 8, 2022

Copy link
Copy Markdown
Contributor

/build

@wyli wyli enabled auto-merge (squash) February 8, 2022 10:30
@wyli

wyli commented Feb 8, 2022

Copy link
Copy Markdown
Contributor

/build

@wyli wyli merged commit a4a6c95 into Project-MONAI:dev Feb 8, 2022
wyli pushed a commit that referenced this pull request Feb 9, 2022
* [DLMED] enhance logger

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] add more tests

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update doc

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] fix packaging test

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] remove typo

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] totally update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update handlers

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update tutorial link

Signed-off-by: Nic Ma <nma@nvidia.com>
wyli pushed a commit that referenced this pull request Feb 9, 2022
* [DLMED] enhance logger

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] add more tests

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update doc

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] fix packaging test

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] remove typo

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] totally update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update handlers

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update tutorial link

Signed-off-by: Nic Ma <nma@nvidia.com>
wyli pushed a commit that referenced this pull request Feb 9, 2022
* [DLMED] enhance logger

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] add more tests

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update doc

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] fix packaging test

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] remove typo

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] totally update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update handlers

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update tutorial link

Signed-off-by: Nic Ma <nma@nvidia.com>
wyli pushed a commit that referenced this pull request Feb 9, 2022
* [DLMED] enhance logger

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] add more tests

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update doc

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] fix packaging test

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] remove typo

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] totally update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update handlers

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update tutorial link

Signed-off-by: Nic Ma <nma@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants