You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the ability to tune the logger on a per FairTask base would be useful.
I can think of two ways to implement this:
redefining the LOG macro to pass a variable -- contextLogLevel -- to Logger. A global contextLogLevel would be set to a default, while specific classes could define a field with that name to override the global level using shadowing. (Yes, a bit ugly).
adjusting the global log level temporarily when running FairTask::InitTasks(), FairTask::ExecuteTasks and the like. This would also propagate the log level to anything called by the task in question. (A bit of a performance overhead. OTOH, the cost of two integer assignments is probably not so bad.)
First, I thought that FairTask::SetVerbosity might already do that, but a some grepping for the use of fVerbose showed that fVerbose only controls some raw std::cout's, so that is probably predating the logger infrastructure. Clearly marking that function as "control the amount of status information written to stdout by FairTask. Not related to the logger functionality, which should be use instead." might make things less confusing.
As a cheap hack, I currently add #define DEBUG INFO locally in the task I want to debug.
The text was updated successfully, but these errors were encountered:
If you are on a recent FairRoot you should be able to call:
fair::Logger::SetConsoleSeverity(fair::Severity::info); // or fair::Severity::debug
to get the second option you described. In this case it is really two integer assignments.
If you use SetLogScreenLevel(const char* severity) that will add a map lookup for the string conversion.
@klenze I have created an issue to track your feature request in the FairLogger repository. Unfortunately, it will have a rather low priority from our side due to lack of manpower. But we are happy to review/accept any contributions.
Closing this in favor of the upstream issue. Let's continue the discussion there.
I think the ability to tune the logger on a per FairTask base would be useful.
I can think of two ways to implement this:
First, I thought that FairTask::SetVerbosity might already do that, but a some grepping for the use of fVerbose showed that fVerbose only controls some raw std::cout's, so that is probably predating the logger infrastructure. Clearly marking that function as "control the amount of status information written to stdout by FairTask. Not related to the logger functionality, which should be use instead." might make things less confusing.
As a cheap hack, I currently add #define DEBUG INFO locally in the task I want to debug.
The text was updated successfully, but these errors were encountered: