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
Remove unnecessary code to figure out logger name #839
Conversation
679e452
to
29db0d8
Compare
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.
@mineo: you were right, we don't need to copy stuff around anymore, which is much better.
picard/log.py
Outdated
except Exception: | ||
return sys.exc_info()[2].tb_frame.f_back | ||
|
||
|
||
class OurLogger(logging.getLoggerClass()): |
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 think you can get rid of this class completely - at least doing that didn't change any of the messages during picard startup with debug mode enabled.
picard/log.py
Outdated
if name.startswith(prefix): | ||
name = name[len(prefix) + 1:].replace(os.path.sep, '.').replace('.__init__', '') | ||
record.name, _ = os.path.splitext(name) | ||
name = pathlib.Path(record.pathname) |
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.
It took me a while to figure out what this function does - I see that it strips picard
from the beginning of a path, removes the file extension and any occurences of .__init__
and for plugins adds the whole path to the file at the beginning of the line, right? In that case, sure, looks reasonable.
Note that before this change, plugin logs were like
/home/wieland/.config/MusicBrainz/Picard/plugins/keep.transltag:19:
now they're like
home.wieland..config.MusicBrainz.Picard.plugins.keep.transltag:19:
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.
Note that before this change, plugin logs were like
/home/wieland/.config/MusicBrainz/Picard/plugins/keep.transltag:19:
now they're like
home.wieland..config.MusicBrainz.Picard.plugins.keep.transltag:19:
Not very fancy, that's only for plugins right ?
Can you post a bigger part of your log ?
EDIT: ignore, i didn't see @samj1912 already fixed it
3b13823
to
02c78eb
Compare
02c78eb
to
9d82269
Compare
Summary
Problem
Solution
Action