Skip to content

Conversation

@ehellbar
Copy link
Collaborator

Applying the same logic for the terminal/GUI output and the InfoLogger.

For the terminal output, there is a new logLevel variable in the DeviceInfo which is initialized to the severity level of the device from the command line or to Info by default. This variable is independent of the DeviceControl::logLevel and it replaces the DeviceControl::logLevel to determine which logs are printed in the terminal. Like this, the DeviceControl::logLevel only sets the severity of the logs displayed in the GUI itself.

@ehellbar ehellbar requested a review from a team as a code owner November 12, 2024 17:04
@github-actions
Copy link
Contributor

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass4
async-2023-pp-apass4
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0
async-2024-PbPb-cpass0
async-2024-PbPb-apass1
async-2024-ppRef-apass1

static char const* const LOG_LEVELS[(int)LogLevel::Size];

/// Map from ROOT log string to log level
static const std::map<std::string, LogLevel> MAP_ROOT_LOG_LEVELS;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::map is really for sorted lookups where you keep adding and removing from the map. Maybe you should use a std::unordered_map. In any case, please move it out of the header.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed this map, used an if...else block instead like for the Fair logs.

Copy link
Collaborator

@davidrohr davidrohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just one question: What will happen with severity unknown? Will it be filtered, e.g. if we say --severity error, or will it be printed?

@ehellbar
Copy link
Collaborator Author

ehellbar commented Nov 19, 2024

severity unknown is numerically bigger than fatal, so it will always be printed. And in the InfoLogger, it will be set to error, which is (and was) the default severity for stderr messages.

@davidrohr davidrohr merged commit 8aba4a9 into AliceO2Group:dev Nov 19, 2024
2 checks passed
@ehellbar ehellbar deleted the dev-rootstderr branch November 25, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants