-
Notifications
You must be signed in to change notification settings - Fork 10
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
Logging Overhaul #947
base: develop
Are you sure you want to change the base?
Logging Overhaul #947
Conversation
DeepCode's analysis on #ef115d found:
Top issues
👉 View analysis in DeepCode’s Dashboard | Configure the bot |
|
||
# Disable the exception stacktrace AXEL : but why? | ||
@force_kwargs(analytics=True, exc_info=False,) | ||
def exception(self, msg, analytics=True, exc_info=False, *args, **kwargs): |
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 kept that because of the original behaviour, but is it necessary?
date = self._getDateString() | ||
id = kwargs.pop('id', self.id_short) | ||
date = MrbLogger._getDateString() | ||
id = id or self.name_short # FIXME id is reserved |
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.
id
should really be refactored to something else
else: | ||
self.logger.error('Could not write exception to analytics, the analytics handler was not initialized.') | ||
self.error('Could not write exception to analytics, the analytics handler was not initialized.', analytics=False) |
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.
prevents loops in case the analytics failed to load
I would like to merge this AFTER the Beta release, so I'm keeping it as a draft for now |
Latest update : Need to ask Gina about the plugin initialisation, and if the dirty MrBeamLogger is used everywhere. |
202baee
to
bcd6b27
Compare
c49d8eb
to
5d6659c
Compare
1f28493
to
6c61b35
Compare
The MrbLogger doesn't use a Logger anymore, because it is one. A lot has been delegated to the logging utilities themselves.
I do like the
force_kwargs
function I wrote if I do say so myself :P It allows to get rid of the hackykwargs['some_key'] = kwargs.get('some_key', default_value)
and averything is in the function definition instead, making it easier for the IDE and linters alike.Anyway, this also allows us to use
logging.getLogger
ormrb_logger.getLogger
interchangeably - they are essentially the same thing. The default Logger class has been set toMrbLogger
as soon as the plugin is loaded in, and theMrbLogger
is compatible with the standard use of Loggers