Skip to content

3769 Enhance logger logic of StatsHandler and DataStats#3774

Merged
wyli merged 17 commits intoProject-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 intoProject-MONAI:devfrom
Nic-Ma:3769-add-log-level

Conversation

@Nic-Ma
Copy link
Copy Markdown
Contributor

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

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
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 7, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 7, 2022

/build

1 similar comment
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 7, 2022

/build

@Nic-Ma Nic-Ma requested review from ericspod, rijobro and wyli February 7, 2022 08:20
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 7, 2022

/build

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 7, 2022

/build

@Nic-Ma Nic-Ma requested a review from wyli February 7, 2022 12:36
Signed-off-by: Nic Ma <[email protected]>
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 7, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 7, 2022

/build

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 7, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 7, 2022

/build

Copy link
Copy Markdown
Contributor

@wyli wyli left a comment

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
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 8, 2022

/integration-test

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 8, 2022

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.

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 8, 2022

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 8, 2022

/build

2 similar comments
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Feb 8, 2022

/build

@wyli
Copy link
Copy Markdown
Contributor

wyli commented Feb 8, 2022

/build

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

wyli commented Feb 8, 2022

/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 <[email protected]>

* [DLMED] add more tests

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update doc

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix packaging test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] remove typo

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] totally update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update handlers

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update tutorial link

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

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add more tests

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update doc

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix packaging test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] remove typo

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] totally update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update handlers

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update tutorial link

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

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add more tests

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update doc

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix packaging test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] remove typo

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] totally update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update handlers

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update tutorial link

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

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add more tests

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update doc

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix packaging test

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] remove typo

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] totally update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update handlers

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update tutorial link

Signed-off-by: Nic Ma <[email protected]>
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