Commit 5692e983 authored by Paul Schütze's avatar Paul Schütze
Browse files

Merge branch 'default_loglevel' into 'master'

Set Default Log Level to WARNING

See merge request allpix-squared/allpix-squared!704
parents d7572940 1760e8c2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -302,7 +302,7 @@ Default value is \textit{modules.root}.
Directories within the ROOT file will be created automatically for all module instantiations.
\item \parameter{log_level}: Specifies the lowest log level which should be reported.
Possible values are \texttt{FATAL}, \texttt{STATUS}, \texttt{ERROR}, \texttt{WARNING}, \texttt{INFO}, \texttt{DEBUG}, \texttt{TRACE} and \texttt{PRNG} where all options are case-insensitive.
Defaults to the \texttt{INFO} level.
Defaults to the \texttt{WARNING} level.
More details and information about the log levels, including how to change them for a particular module, can be found in Section~\ref{sec:logging_verbosity}.
Can be overwritten by the \texttt{-v} parameter on the command line (see Section~\ref{sec:allpix_executable}).
\item \parameter{log_format}: Determines the log message format to display.
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ random_seed = 0
[DopingProfileReader]
model = "regions"
doping_concentration = [10, 11], [12, 13]
log_level = INFO

#PASS (INFO) [I:DopingProfileReader:mydetector] Set constant doping concentration of 13000/cm/cm/cm at sensor depth 12mm
#LABEL coverage
+3 −3
Original line number Diff line number Diff line
@@ -61,15 +61,15 @@ Allpix::Allpix(std::string config_file_name,
    // Set the log level from config if not specified earlier
    std::string log_level_string;
    if(Log::getReportingLevel() == LogLevel::NONE) {
        log_level_string = global_config.get<std::string>("log_level", "INFO");
        log_level_string = global_config.get<std::string>("log_level", "WARNING");
        std::transform(log_level_string.begin(), log_level_string.end(), log_level_string.begin(), ::toupper);
        try {
            LogLevel log_level = Log::getLevelFromString(log_level_string);
            Log::setReportingLevel(log_level);
        } catch(std::invalid_argument& e) {
            LOG(ERROR) << "Log level \"" << log_level_string
                       << "\" specified in the configuration is invalid, defaulting to INFO instead";
            Log::setReportingLevel(LogLevel::INFO);
                       << "\" specified in the configuration is invalid, defaulting to WARNING instead";
            Log::setReportingLevel(LogLevel::WARNING);
        }
    } else {
        log_level_string = Log::getStringFromLevel(Log::getReportingLevel());