[v7r2] Make subLogger more flexible#4610
Conversation
38f1678 to
d834d34
Compare
|
This is IMHO ok. |
andresailer
left a comment
There was a problem hiding this comment.
some comments for tests and docstrings.
|
(from what I gather from private discussion) To make things very clear (@aldbr you should state that in the PR description), this means that there would be no way anymore (and rightly so) to set two backend to |
d834d34 to
d1a0abf
Compare
Alright, I've just added a comment about the level at the end of the PR description. Well, yes and no. The log record 'message' is blocked at the Logging (logger) level because Here the log record is not blocked by the Logging because
Is it clear? |
chaen
left a comment
There was a problem hiding this comment.
I am happy if this goes to v7r1, since we (LHCb) will run more hackaton with it. But I believe FranceGrille (@atsareg) and GridPP (@marianne013 ) are already quite ahead with the use of v7r1, so it's only fair if they decide if it can go or not.
|
We are only running v7r1 in pre-prod, but please don't break it any more than it already is. |
d1a0abf to
5e195d8
Compare
|
@marianne013 😆 So that means v7r2 ? Fair enough. |
|
@aldbr can you please rebase to v7r2? Then this can be approved and merged. |
5e195d8 to
5d626f1
Compare
d9af906 to
523bfb4
Compare
4b4837c to
c9f801b
Compare
|
Please, rebase on the current integration branch |
c9f801b to
f7490ee
Compare
f7490ee to
ad7a227
Compare
ad7a227 to
5cf9340
Compare
|
I guess the test is failing because of cddf80c |
In response to: #4524
This PR makes gLogger more "flexible":
showHeaders()andshowThreadIDs())showTimeStamps(): display or hide the timestampshowContexts(): display or hide the component and the logger nameFormatterto wrap aFormatterjust to use it in a backendpytestBEGINRELEASENOTES
*FrameworkSystem
NEW: new methods to change the log record format: showTimeStamps and showContexts
CHANGE: make gLogger more flexible: level and format options can be set by subloggers
ENDRELEASENOTES
*About the level change:
The level is currently managed in a strange way:
Logging.setLevel()just change the level of the Backends (so of the handlers) attached to the LoggingThis was done in order to make sure that the centralized logging could not be disabled: all logs from all Logging objects go to a MessageQueue for instance.
In practice, subloggers don't have any Backend and just propagate the logs to LoggingRoot that spreads the logs across its Backends.
Thus,
Logging.setLevel()has no effect from a sublogger.In this PR, the Logging level is attached to the logger level to better respect the standard mechanism:
Logging.setLevel()works from every sublogger and change the level of its underlying loggerThis means that the centralized logging can only get logs that respects the following condition:
log record level > logger level:LogLevelin the configuration