Skip to content

LogfileHandler#5064

Merged
wyli merged 10 commits intoProject-MONAI:devfrom
ericspod:logfilehandler
Sep 5, 2022
Merged

LogfileHandler#5064
wyli merged 10 commits intoProject-MONAI:devfrom
ericspod:logfilehandler

Conversation

@ericspod
Copy link
Copy Markdown
Member

@ericspod ericspod commented Sep 1, 2022

Signed-off-by: Eric Kerfoot [email protected]

Description

Adds a handler for directing logging information to a file once an Engine object starts and then doing the cleanup when it completes.

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.

@ericspod ericspod requested review from Nic-Ma and wyli September 1, 2022 22:47
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.

looks good to me, could you replace assert with valueerror+some meaningful error messages?

@ericspod
Copy link
Copy Markdown
Member Author

ericspod commented Sep 2, 2022

Actually the asserts were for mypy to figure out what state the handler would be in when the Ignite events occur. It's doing some sort of data flow analysis and using the asserts as hints about state.

@wyli
Copy link
Copy Markdown
Contributor

wyli commented Sep 2, 2022

I think these recommended methods should be used for type narrowing https://mypy.readthedocs.io/en/latest/type_narrowing.html

@ericspod
Copy link
Copy Markdown
Member Author

ericspod commented Sep 2, 2022

The page does also mention using assert for this which seems to be less code, the changes I did here are move verbose now.

@wyli
Copy link
Copy Markdown
Contributor

wyli commented Sep 2, 2022

/build

Copy link
Copy Markdown
Contributor

@Nic-Ma Nic-Ma left a comment

Choose a reason for hiding this comment

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

Thanks for the update.
The use case makes sense to me.
Please try to use it in the tutorial examples or some model-zoo bundles in the future.

Thanks.

@Nic-Ma
Copy link
Copy Markdown
Contributor

Nic-Ma commented Sep 3, 2022

/build

@wyli wyli enabled auto-merge (squash) September 3, 2022 21:35
@wyli
Copy link
Copy Markdown
Contributor

wyli commented Sep 3, 2022

/build

2 similar comments
@wyli
Copy link
Copy Markdown
Contributor

wyli commented Sep 4, 2022

/build

@pxLi
Copy link
Copy Markdown
Contributor

pxLi commented Sep 5, 2022

/build

@wyli wyli merged commit b1aa40d into Project-MONAI:dev Sep 5, 2022
@ericspod ericspod deleted the logfilehandler branch September 5, 2022 11:57
wyli pushed a commit to yashika-git/MONAI that referenced this pull request Sep 6, 2022
Signed-off-by: Eric Kerfoot <[email protected]>

### Description
Adds a handler for directing logging information to a file once an `Engine` object starts and then doing the cleanup when it completes.

### Status
**Ready**

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not applicable items -->
- [x] 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).
- [x] 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`.
- [x] In-line docstrings updated.
- [x] Documentation updated, tested `make html` command in the `docs/` folder.

Signed-off-by: Eric Kerfoot <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.

4 participants