-
Notifications
You must be signed in to change notification settings - Fork 12
Cps 43 logger improvements #67
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
Cps 43 logger improvements #67
Conversation
Cps 43 logger improvements
| sformat = request.id + " " + request.contract.marketplace.id + base | ||
| [handler.setFormatter(logging.Formatter(sformat, "%I:%M:%S")) | ||
| for handler in self.__class__.logger.handlers] | ||
|
|
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.
Mb use the default setting for logger
Right now we use thrice this block. Only field sformat different
handlers = [copy.copy(hdlr) for hdlr in global_logger.handlers]
log_level = global_logger.level
self.__class__.logger.propagate = False
self.__class__.logger.setLevel(log_level)
[self.__class__.logger.addHandler(hdlr) for hdlr in handlers]
base = " %(levelname)-6s; %(asctime)s; %(name)-6s; %(module)s:%(funcName)s:line" \
"-%(lineno)d: %(message)s"
sformat = request.id + " " + request.contract.marketplace.id + base
[handler.setFormatter(logging.Formatter(sformat, "%I:%M:%S"))
for handler in self.__class__.logger.handlers]
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.
Javi what you think about that suggestion?
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.
Hasn't that been fixed in the commits made afterwards?
Cps 43 logger improvements
Codecov Report
@@ Coverage Diff @@
## master #67 +/- ##
=========================================
- Coverage 92.78% 92.7% -0.08%
=========================================
Files 67 67
Lines 1872 1893 +21
=========================================
+ Hits 1737 1755 +18
- Misses 135 138 +3
Continue to review full report at Codecov.
|
Add custom loggers to the automation classes, that automatically add relevant info of the request being processed. Legacy global logger still working in order to have a context-independent logger.