Skip to content

fix: increase stacklevel in LoggingMachine log calls#2476

Merged
ibraheem-abe merged 13 commits intoopentensor:stagingfrom
zyzniewski-reef:fix/logger_stacklevel
Nov 26, 2024
Merged

fix: increase stacklevel in LoggingMachine log calls#2476
ibraheem-abe merged 13 commits intoopentensor:stagingfrom
zyzniewski-reef:fix/logger_stacklevel

Conversation

@zyzniewski-reef
Copy link
Contributor

Bug

Fixes #2449

Description of the Change

"loggingmachine.py" is printed in logs because LoggingMachine does not unstack it's internal calls to wrapped logger

Alternate Designs

Adding LoggerAdapter

Possible Drawbacks

None

Verification Process

Ran unittests.
Checked logs are formatted correctly.

Release Notes

  • Fixed caller's module filename in logs

@basfroman
Copy link
Collaborator

Thank you for this contribution!
Could you please add the test which is testing exact PR's behavior?
You can log all of types of logging (debug, info, etc) in the test and then capture and parse the log to be make sure that test module name is in the log line.

@zyzniewski-reef
Copy link
Contributor Author

ref: python/cpython#97941

Copy link
Collaborator

@basfroman basfroman left a comment

Choose a reason for hiding this comment

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

plz fix ruff formatter issue

Copy link
Collaborator

@basfroman basfroman left a comment

Choose a reason for hiding this comment

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

Pls accept changes and we can move forward with approval

zyzniewski-reef and others added 2 commits November 26, 2024 18:29
Co-authored-by: Roman <167799377+roman-opentensor@users.noreply.github.com>
Co-authored-by: Roman <167799377+roman-opentensor@users.noreply.github.com>
@ibraheem-abe ibraheem-abe merged commit 599be1f into opentensor:staging Nov 26, 2024
@ibraheem-abe ibraheem-abe mentioned this pull request Nov 26, 2024
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.

[SDK] Replace loggingmachine.py to real module name during logging

4 participants