[core] Add ROOT_LOG env var support for RLogger#21455
[core] Add ROOT_LOG env var support for RLogger#21455deveshbervar wants to merge 3 commits intoroot-project:masterfrom
Conversation
|
@dpiparo ping! PR ready for review. I have implemented the ROOT_LOG |
|
Is testing perhaps still missing? |
|
Hi @dpiparo, tests have been added in core/foundation/test/RLoggerEnvVar.cxx. Since RLogManager is a static singleton that parses ROOT_LOG once at Please let me know if this approach is acceptable or if you'd prefer |
| // Is there a specific level for the channel? If so, take that, | ||
| // overruling the global one. | ||
| if (channel->GetEffectiveVerbosity(*this) < entry.fLevel) | ||
| return true; | ||
|
|
||
| // Lock-protected extraction of handlers, such that they don't get added during the | ||
| // handler iteration. |
There was a problem hiding this comment.
Why are those code comments no longer relevant/helpful?
|
Hi @pcanal, |
Why
Enables per-channel verbosity to be configured at startup via an
environment variable, without recompiling ROOT. This allows tracing
(e.g. CMS autoparsing after #7609) by simply setting ROOT_LOG.
What
Setting ROOT_LOG at startup now configures RLogger channel verbosity:
export ROOT_LOG='ROOT.InterpreterPerf=Debug(3),ROOT.RBrowser=Error'
Supported levels: Fatal, Error, Warning, Info, Debug, Debug(N).
gDebug is also applied as a global verbosity floor.
Changes
RLogger.hxx: addedfEnvVerbositymap toRLogManager, addedGetEnvVerbosity(), updatedGetEffectiveVerbosity()to checkper-channel env overrides before falling back to global verbosity
RLogger.cxx: constructor now parses ROOT_LOG and applies gDebugTests
Since RLogManager is a static singleton initialized once at process
startup, setenv() mid-test does not affect it. I would appreciate
guidance from the maintainer on the recommended approach for testing
this feature. Happy to add tests based on your feedback.