Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logging problem #39

Merged
merged 3 commits into from
Dec 7, 2022
Merged

Fix logging problem #39

merged 3 commits into from
Dec 7, 2022

Conversation

zzachw
Copy link
Collaborator

@zzachw zzachw commented Dec 7, 2022

No description provided.

@zzachw zzachw requested a review from ycq091044 December 7, 2022 07:26
Copy link
Collaborator

@ycq091044 ycq091044 left a comment

Choose a reason for hiding this comment

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

LGTM. Will this replacement from "logging" to "logger" solve the printing problem? I would be interested to know why.

@@ -10,7 +10,10 @@
os.makedirs(BASE_CACHE_PATH)

# logging
logger = logging.getLogger()
logger = logging.getLogger(__name__)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could I learn what does this change mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

logging.getLogger() gives you the root logger (shared by all applications using the logging module) while logging.getLogger(__name__) gives you a child logger (whose name is "pyhealth").

I changed this because we don't want to modify the behavior of the root logger which may be used outside of our package.

FYI: a good reference https://colab.research.google.com/github/aviadr1/learn-advanced-python/blob/master/content/15_logging/logging_in_python.ipynb

@zzachw zzachw merged commit 6aad348 into develop Dec 7, 2022
zzachw added a commit that referenced this pull request Dec 7, 2022
* fix duplicated logging problem

* fix rnn dropout warning

* reformat dataset statistics print
@zzachw zzachw deleted the fix-logging branch December 7, 2022 23:11
zzachw added a commit that referenced this pull request Dec 7, 2022
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.

None yet

2 participants