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: increase stacklevel in LoggingMachine log calls #2476

Merged

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

@roman-opentensor
Copy link
Contributor

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
Contributor

@roman-opentensor roman-opentensor 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
Contributor

@roman-opentensor roman-opentensor 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

bittensor/utils/btlogging/loggingmachine.py Outdated Show resolved Hide resolved
bittensor/utils/btlogging/loggingmachine.py Outdated Show resolved Hide resolved
@ibraheem-opentensor ibraheem-opentensor merged commit 599be1f into opentensor:staging Nov 26, 2024
26 checks passed
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