-
Notifications
You must be signed in to change notification settings - Fork 111
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
Polish trace back-logging and other logging aspects #6746
Conversation
This provides the space for the necessary documentation.
This change aims to make the output more compact and more informative. The stack frame of the log handler re-emitting a message is not longer included in the report. This is a uniform internal behavior that is identical for all messages, and not useful for debugging with this utility (because the previously established removal of internal logging handling from the traceback already made it unsuitable for debugging logging code -- which is perfectly fine). Was ``` % DATALAD_LOG_TRACEBACK=collide dl -l debug status [DEBUG ] datalad:33>main:86>parser:119,369>log:223 Command line args 1st pass for DataLad 0.16.2+190.gd657c17fe. Parsed: Namespace() Unparsed: ['status'] [DEBUG ] ...>main:94>log:223 Parsing known args among ['/home/mih/env/datalad-dev/bin/datalad', '-l', 'debug', 'status'] ``` Now ``` % DATALAD_LOG_TRACEBACK=collide dl -l debug status [DEBUG ] datalad:33>main:86>parser:119,369 Command line args 1st pass for DataLad 0.16.2+194.g83e04f37f.dirty. Parsed: Namespace() Unparsed: ['status'] [DEBUG ] …>main:94 Parsing known args among ['/home/mih/env/datalad-dev/bin/datalad', '-l', 'debug', 'status'] ``` `DATALAD_LOG_TRACEBACK=1` will now typically report the origin of any log message, rather than a location in `log.py`, a more natural behavior IMHO. Due to the previously established removal of "common" stack frames, the traceback depth already could not be interpreted in a strict manner. Was ``` % DATALAD_LOG_TRACEBACK=1 dl -l debug status [DEBUG ] ...>log:223 Command line args 1st pass for DataLad 0.16.2+190.gd657c17fe. Parsed: Namespace() Unparsed: ['status'] [DEBUG ] ...>log:223 Parsing known args among ['/home/mih/env/datalad-dev/bin/datalad', '-l', 'debug', 'status'] ``` Now ``` % DATALAD_LOG_TRACEBACK=1 dl -l debug status [DEBUG ] parser:369 Command line args 1st pass for DataLad 0.16.2+194.g83e04f37f.dirty. Parsed: Namespace() Unparsed: ['status'] [DEBUG ] main:94 Parsing known args among ['/home/mih/env/datalad-dev/bin/datalad', '-l', 'debug', 'status'] ``` The actual behavior of this switch, and that it is not a proper config switch, is now documented. Closes datalad#6744
Main update of related docs is coming via datalad#6734
Code Climate has analyzed commit 2faad43 and detected 2 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Codecov Report
@@ Coverage Diff @@
## master #6746 +/- ##
==========================================
+ Coverage 88.79% 90.41% +1.62%
==========================================
Files 353 353
Lines 45744 45763 +19
==========================================
+ Hits 40617 41376 +759
+ Misses 5127 4387 -740
Continue to review full report at Codecov.
|
'This setting is only in effect when given as an ' | ||
'environment variable DATALAD_LOG_TRACEBACK. ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you give me permission to push to your PR adopted version of
0b604b6
and adjust doc here as
'This setting is only in effect when given as an ' | |
'environment variable DATALAD_LOG_TRACEBACK. ' | |
'This setting is in effect if set from command line via `-c` option. ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also would need to add doc record for DATALAD_LOG_VMEM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not looked into that other commit closely. If you think this PR requires it, go ahead. Otherwise, I think a new PRs is more suitable than piling on.
Not sure, what's the state of this. Do you intend to push, @yarikoptic ? Otherwise I'd say let's merge. |
Changelog
💫 Enhancements and new features
DATALAD_LOG_TRACEBACK
was improved to yield a more compact report. The documentation for this feature has been clarified. Closes Documentation and behavior of datalad.log.traceback misleading #6744Documentation
log_progress()
is now included in the renderer documentation. Fixeslog_progress()
and other tools indatalad.log
not in API docs #6731