mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-12 16:21:13 +00:00
* split log console output sink into two sinks, one for cout and one for cerr.
* remove logger_oldboost_version files and add ifdef boost version in logger.cxx instead * change default logger level in FairMqProgOptions
This commit is contained in:
parent
54e1777c00
commit
a75486f3ec
|
@ -15,13 +15,7 @@
|
|||
#ifndef FAIRMQLOGGER_H_
|
||||
#define FAIRMQLOGGER_H_
|
||||
|
||||
#include <boost/version.hpp>
|
||||
|
||||
#if BOOST_VERSION < 105600
|
||||
#include "logger/logger_oldboost_version.h"
|
||||
#else
|
||||
#include "logger/logger.h"
|
||||
#endif
|
||||
typedef unsigned long long timestamp_t;
|
||||
|
||||
timestamp_t get_timestamp();
|
||||
|
|
|
@ -19,11 +19,8 @@ set(LINK_DIRECTORIES ${Boost_LIBRARY_DIRS})
|
|||
|
||||
link_directories(${LINK_DIRECTORIES})
|
||||
|
||||
if(NOT ("${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}" VERSION_LESS "1.56") )
|
||||
set(SRCS logger.cxx)
|
||||
else()
|
||||
set(SRCS logger_oldboost_version.cxx)
|
||||
endif()
|
||||
set(SRCS logger.cxx)
|
||||
|
||||
set(LIBRARY_NAME fairmq_logger)
|
||||
|
||||
set(DEPENDENCIES
|
||||
|
@ -36,11 +33,9 @@ set(DEPENDENCIES
|
|||
pthread
|
||||
)
|
||||
|
||||
|
||||
if(NOT ("${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}" VERSION_LESS "1.56") )
|
||||
install(FILES logger.h logger_def.h DESTINATION include/logger)
|
||||
else()
|
||||
install(FILES logger_oldboost_version.h logger_def.h fairroot_null_deleter.h DESTINATION include/logger)
|
||||
install(FILES logger.h logger_def.h DESTINATION include/logger)
|
||||
if("${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}" VERSION_LESS "1.56")
|
||||
install(FILES fairroot_null_deleter.h DESTINATION include/logger)
|
||||
endif()
|
||||
|
||||
|
||||
|
|
|
@ -6,13 +6,21 @@
|
|||
* copied verbatim in the file "LICENSE" *
|
||||
********************************************************************************/
|
||||
#include "logger.h"
|
||||
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/log/core/core.hpp>
|
||||
#include <boost/log/expressions/formatters/date_time.hpp>
|
||||
#include <boost/log/sinks/text_ostream_backend.hpp>
|
||||
#include <boost/log/support/date_time.hpp>
|
||||
#include <boost/log/utility/setup/common_attributes.hpp>
|
||||
|
||||
#if BOOST_VERSION < 105600
|
||||
#include "fairroot_null_deleter.h"
|
||||
typedef fairroot::null_deleter empty_deleter_t;
|
||||
#else
|
||||
#include <boost/core/null_deleter.hpp>
|
||||
typedef boost::null_deleter empty_deleter_t;
|
||||
#endif
|
||||
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
@ -37,20 +45,48 @@ BOOST_LOG_GLOBAL_LOGGER_INIT(global_logger, src::severity_logger_mt)
|
|||
return global_logger;
|
||||
}
|
||||
|
||||
void init_log_console()
|
||||
void init_log_console(bool color_format)
|
||||
{
|
||||
// add a text sink
|
||||
typedef sinks::synchronous_sink<sinks::text_ostream_backend> text_sink;
|
||||
|
||||
|
||||
// CONSOLE - all severity except error
|
||||
boost::shared_ptr<text_sink> sink = boost::make_shared<text_sink>();
|
||||
// add "console" output stream to our sink
|
||||
sink->locked_backend()->add_stream(boost::shared_ptr<std::ostream>(&std::clog, boost::null_deleter()));
|
||||
sink->locked_backend()->add_stream(boost::shared_ptr<std::ostream>(&std::cout, empty_deleter_t()));
|
||||
|
||||
// specify the format of the log message
|
||||
sink->set_formatter(&init_log_formatter<tag_console>);
|
||||
if(color_format)
|
||||
sink->set_formatter(&init_log_formatter<tag_console>);
|
||||
else
|
||||
sink->set_formatter(&init_log_formatter<tag_file>);
|
||||
|
||||
sink->set_filter(severity != SEVERITY_ERROR);
|
||||
// add sink to the core
|
||||
logging::core::get()->add_sink(sink);
|
||||
|
||||
|
||||
// CONSOLE - only severity error
|
||||
boost::shared_ptr<text_sink> sink_error = boost::make_shared<text_sink>();
|
||||
sink_error->locked_backend()->add_stream(boost::shared_ptr<std::ostream>(&std::cerr, empty_deleter_t()));
|
||||
|
||||
if(color_format)
|
||||
sink_error->set_formatter(&init_log_formatter<tag_console>);
|
||||
else
|
||||
sink_error->set_formatter(&init_log_formatter<tag_file>);
|
||||
|
||||
sink_error->set_filter(severity == SEVERITY_ERROR);
|
||||
logging::core::get()->add_sink(sink_error);
|
||||
}
|
||||
|
||||
void reinit_logger(bool color_format)
|
||||
{
|
||||
logging::core::get()->remove_all_sinks();
|
||||
init_log_console(color_format);
|
||||
}
|
||||
|
||||
|
||||
void init_log_file(const std::string& filename, custom_severity_level threshold, log_op::operation op, const std::string& id)
|
||||
{
|
||||
// add a text sink
|
||||
|
|
|
@ -88,7 +88,9 @@ namespace log_op
|
|||
|
||||
|
||||
// declaration of the init function for the global logger
|
||||
void init_log_console();
|
||||
|
||||
void init_log_console(bool color_format=true);
|
||||
void reinit_logger(bool color_format);
|
||||
void init_log_file( const std::string& filename,
|
||||
custom_severity_level threshold=SEVERITY_THRESHOLD,
|
||||
log_op::operation=log_op::GREATER_EQ_THAN,
|
||||
|
|
|
@ -87,6 +87,7 @@ inline std::string write_in(const std::string& text_in_bold)
|
|||
// typedef
|
||||
typedef fairmq::severity_level custom_severity_level;
|
||||
#define SEVERITY_THRESHOLD custom_severity_level::TRACE
|
||||
#define SEVERITY_ERROR custom_severity_level::ERROR
|
||||
|
||||
// tags used for log console or file formatting
|
||||
struct tag_console;
|
||||
|
|
|
@ -1,235 +0,0 @@
|
|||
|
||||
|
||||
// fix backward compability issue with boost<1.56
|
||||
|
||||
/********************************************************************************
|
||||
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* *
|
||||
* This software is distributed under the terms of the *
|
||||
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
|
||||
* copied verbatim in the file "LICENSE" *
|
||||
********************************************************************************/
|
||||
#include "logger_oldboost_version.h"
|
||||
#include "fairroot_null_deleter.h"
|
||||
|
||||
#include <boost/log/core/core.hpp>
|
||||
#include <boost/log/expressions/formatters/date_time.hpp>
|
||||
#include <boost/log/sinks/text_ostream_backend.hpp>
|
||||
#include <boost/log/support/date_time.hpp>
|
||||
#include <boost/log/utility/setup/common_attributes.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include <ostream>
|
||||
|
||||
|
||||
namespace logging = boost::log;
|
||||
namespace src = boost::log::sources;
|
||||
namespace expr = boost::log::expressions;
|
||||
namespace sinks = boost::log::sinks;
|
||||
namespace attrs = boost::log::attributes;
|
||||
|
||||
|
||||
|
||||
BOOST_LOG_GLOBAL_LOGGER_INIT(global_logger, src::severity_logger_mt)
|
||||
{
|
||||
src::severity_logger_mt<custom_severity_level> global_logger;
|
||||
global_logger.add_attribute("TimeStamp", attrs::local_clock());
|
||||
init_log_console();
|
||||
return global_logger;
|
||||
}
|
||||
|
||||
void init_log_console()
|
||||
{
|
||||
// add a text sink
|
||||
typedef sinks::synchronous_sink<sinks::text_ostream_backend> text_sink;
|
||||
boost::shared_ptr<text_sink> sink = boost::make_shared<text_sink>();
|
||||
// add "console" output stream to our sink
|
||||
sink->locked_backend()->add_stream(boost::shared_ptr<std::ostream>(&std::clog, fairroot::null_deleter()));
|
||||
|
||||
// specify the format of the log message
|
||||
sink->set_formatter(&init_log_formatter<tag_console>);
|
||||
// add sink to the core
|
||||
logging::core::get()->add_sink(sink);
|
||||
}
|
||||
|
||||
void init_log_file(const std::string& filename, custom_severity_level threshold, log_op::operation op, const std::string& id)
|
||||
{
|
||||
// add a text sink
|
||||
std::string formatted_filename(filename);
|
||||
formatted_filename+=id;
|
||||
formatted_filename+="_%Y-%m-%d_%H-%M-%S.%N.log";
|
||||
boost::shared_ptr< sinks::text_file_backend > backend =
|
||||
boost::make_shared< sinks::text_file_backend >
|
||||
(
|
||||
boost::log::keywords::file_name = formatted_filename,
|
||||
boost::log::keywords::rotation_size = 10 * 1024 * 1024,
|
||||
// rotate at midnight every day
|
||||
boost::log::keywords::time_based_rotation = sinks::file::rotation_at_time_point(0, 0, 0),
|
||||
// log collector,
|
||||
// -- maximum total size of the stored log files is 1GB.
|
||||
// -- minimum free space on the drive is 2GB
|
||||
boost::log::keywords::max_size = 1000 * 1024 * 1024,
|
||||
boost::log::keywords::min_free_space = 2000 * 1024 * 1024,
|
||||
boost::log::keywords::auto_flush = true
|
||||
//keywords::time_based_rotation = &is_it_time_to_rotate
|
||||
);
|
||||
typedef sinks::synchronous_sink< sinks::text_file_backend > sink_t;
|
||||
boost::shared_ptr< sink_t > sink(new sink_t(backend));
|
||||
|
||||
// specify the format of the log message
|
||||
sink->set_formatter(&init_log_formatter<tag_file>);
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case log_op::operation::EQUAL :
|
||||
sink->set_filter(severity == threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::GREATER_THAN :
|
||||
sink->set_filter(severity > threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::GREATER_EQ_THAN :
|
||||
sink->set_filter(severity >= threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::LESS_THAN :
|
||||
sink->set_filter(severity < threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::LESS_EQ_THAN :
|
||||
sink->set_filter(severity <= threshold);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
logging::core::get()->add_sink(sink);
|
||||
}
|
||||
|
||||
// temporary : to be replaced with c++11 lambda
|
||||
void set_global_log_level(log_op::operation op, custom_severity_level threshold )
|
||||
{
|
||||
switch (threshold)
|
||||
{
|
||||
case custom_severity_level::TRACE :
|
||||
set_global_log_level_operation(op,custom_severity_level::TRACE);
|
||||
break;
|
||||
|
||||
case custom_severity_level::DEBUG :
|
||||
set_global_log_level_operation(op,custom_severity_level::DEBUG);
|
||||
break;
|
||||
|
||||
case custom_severity_level::RESULTS :
|
||||
set_global_log_level_operation(op,custom_severity_level::RESULTS);
|
||||
break;
|
||||
|
||||
case custom_severity_level::INFO :
|
||||
set_global_log_level_operation(op,custom_severity_level::INFO);
|
||||
break;
|
||||
|
||||
case custom_severity_level::WARN :
|
||||
set_global_log_level_operation(op,custom_severity_level::WARN);
|
||||
break;
|
||||
|
||||
case custom_severity_level::STATE :
|
||||
set_global_log_level_operation(op,custom_severity_level::STATE);
|
||||
break;
|
||||
|
||||
case custom_severity_level::ERROR :
|
||||
set_global_log_level_operation(op,custom_severity_level::ERROR);
|
||||
break;
|
||||
|
||||
case custom_severity_level::NOLOG :
|
||||
set_global_log_level_operation(op,custom_severity_level::NOLOG);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void set_global_log_level_operation(log_op::operation op, custom_severity_level threshold )
|
||||
{
|
||||
switch (op)
|
||||
{
|
||||
case log_op::operation::EQUAL :
|
||||
boost::log::core::get()->set_filter(severity == threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::GREATER_THAN :
|
||||
boost::log::core::get()->set_filter(severity > threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::GREATER_EQ_THAN :
|
||||
boost::log::core::get()->set_filter(severity >= threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::LESS_THAN :
|
||||
boost::log::core::get()->set_filter(severity < threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::LESS_EQ_THAN :
|
||||
boost::log::core::get()->set_filter(severity <= threshold);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void init_new_file(const std::string& filename, custom_severity_level threshold, log_op::operation op)
|
||||
{
|
||||
// add a file text sink with filters but without any formatting
|
||||
std::string formatted_filename(filename);
|
||||
formatted_filename+=".%N.txt";
|
||||
boost::shared_ptr< sinks::text_file_backend > backend =
|
||||
boost::make_shared< sinks::text_file_backend >
|
||||
(
|
||||
boost::log::keywords::file_name = formatted_filename,
|
||||
boost::log::keywords::rotation_size = 10 * 1024 * 1024,
|
||||
// rotate at midnight every day
|
||||
boost::log::keywords::time_based_rotation = sinks::file::rotation_at_time_point(0, 0, 0),
|
||||
// log collector,
|
||||
// -- maximum total size of the stored log files is 1GB.
|
||||
// -- minimum free space on the drive is 2GB
|
||||
boost::log::keywords::max_size = 1000 * 1024 * 1024,
|
||||
boost::log::keywords::min_free_space = 2000 * 1024 * 1024,
|
||||
boost::log::keywords::auto_flush = true
|
||||
//keywords::time_based_rotation = &is_it_time_to_rotate
|
||||
);
|
||||
typedef sinks::synchronous_sink< sinks::text_file_backend > sink_t;
|
||||
boost::shared_ptr< sink_t > sink(new sink_t(backend));
|
||||
|
||||
//sink->set_formatter(&init_file_formatter);
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case log_op::operation::EQUAL :
|
||||
sink->set_filter(severity == threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::GREATER_THAN :
|
||||
sink->set_filter(severity > threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::GREATER_EQ_THAN :
|
||||
sink->set_filter(severity >= threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::LESS_THAN :
|
||||
sink->set_filter(severity < threshold);
|
||||
break;
|
||||
|
||||
case log_op::operation::LESS_EQ_THAN :
|
||||
sink->set_filter(severity <= threshold);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
logging::core::get()->add_sink(sink);
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
/*
|
||||
* File: logger_oldboost_version.h
|
||||
* Author: winckler
|
||||
*
|
||||
* Created on September 24, 2015, 10:56 AM
|
||||
*/
|
||||
|
||||
#ifndef LOGGER_OLDBOOST_VERSION_H
|
||||
#define LOGGER_OLDBOOST_VERSION_H
|
||||
|
||||
#define BOOST_LOG_DYN_LINK 1 // necessary when linking the boost_log library dynamically
|
||||
|
||||
// std
|
||||
#include <type_traits>
|
||||
#include <cstddef>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
#include <boost/log/sources/global_logger_storage.hpp>
|
||||
#include <boost/log/expressions/attr_fwd.hpp>
|
||||
|
||||
|
||||
|
||||
|
||||
// WARNING : pragma commands to hide boost Wshadow warning
|
||||
#if defined(__clang__)
|
||||
_Pragma("clang diagnostic push")
|
||||
_Pragma("clang diagnostic ignored \"-Wshadow\"")
|
||||
// boost
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time_io.hpp>
|
||||
#include <boost/log/sources/severity_logger.hpp>
|
||||
#include <boost/log/utility/formatting_ostream.hpp>
|
||||
#include <boost/log/expressions.hpp>
|
||||
#include <boost/log/expressions/attr.hpp>
|
||||
#include <boost/log/utility/formatting_ostream.hpp>
|
||||
#include <boost/log/sinks/text_file_backend.hpp>
|
||||
#include <boost/log/sinks/sync_frontend.hpp>
|
||||
// fairmq
|
||||
#include "logger_def.h"
|
||||
_Pragma("clang diagnostic pop")
|
||||
#elif defined(__GNUC__) || defined(__GNUG__)
|
||||
_Pragma("GCC diagnostic push")
|
||||
_Pragma("GCC diagnostic ignored \"-Wshadow\"")
|
||||
// boost
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time_io.hpp>
|
||||
#include <boost/log/sources/severity_logger.hpp>
|
||||
#include <boost/log/utility/formatting_ostream.hpp>
|
||||
#include <boost/log/expressions.hpp>
|
||||
#include <boost/log/expressions/attr.hpp>
|
||||
#include <boost/log/utility/formatting_ostream.hpp>
|
||||
#include <boost/log/sinks/text_file_backend.hpp>
|
||||
#include <boost/log/sinks/sync_frontend.hpp>
|
||||
// fairmq
|
||||
#include "logger_def.h"
|
||||
_Pragma("GCC diagnostic pop")
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
// Note : the following types and values must be defined in the included logger_def.h :
|
||||
// 1- custom_severity_level
|
||||
// 2- SEVERITY_THRESHOLD
|
||||
// 3- tag_console
|
||||
// 4- tag_file
|
||||
|
||||
// Note : operation enum temporary : (until we replace it with c++11 lambda expression)
|
||||
namespace log_op
|
||||
{
|
||||
enum operation
|
||||
{
|
||||
EQUAL,
|
||||
GREATER_THAN,
|
||||
GREATER_EQ_THAN,
|
||||
LESS_THAN,
|
||||
LESS_EQ_THAN
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// declaration of the init function for the global logger
|
||||
void init_log_console();
|
||||
void init_log_file( const std::string& filename,
|
||||
custom_severity_level threshold=SEVERITY_THRESHOLD,
|
||||
log_op::operation=log_op::GREATER_EQ_THAN,
|
||||
const std::string& id=""
|
||||
);
|
||||
|
||||
void init_new_file( const std::string& filename,
|
||||
custom_severity_level threshold,
|
||||
log_op::operation op
|
||||
);
|
||||
|
||||
void set_global_log_level( log_op::operation op=log_op::GREATER_EQ_THAN,
|
||||
custom_severity_level threshold=SEVERITY_THRESHOLD );
|
||||
void set_global_log_level_operation( log_op::operation op=log_op::GREATER_EQ_THAN,
|
||||
custom_severity_level threshold=SEVERITY_THRESHOLD );
|
||||
// register a global logger (declaration)
|
||||
BOOST_LOG_GLOBAL_LOGGER(global_logger, boost::log::sources::severity_logger_mt<custom_severity_level>)
|
||||
|
||||
BOOST_LOG_ATTRIBUTE_KEYWORD(fairmq_logger_timestamp, "TimeStamp", boost::posix_time::ptime)
|
||||
BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity", custom_severity_level)
|
||||
|
||||
|
||||
template<typename T>
|
||||
void init_log_formatter(const boost::log::record_view &view, boost::log::formatting_ostream &os)
|
||||
{
|
||||
os << "[" ;
|
||||
|
||||
if(std::is_same<T,tag_console>::value)
|
||||
os<<"\033[01;36m";
|
||||
|
||||
auto date_time_formatter =
|
||||
boost::log::expressions::stream
|
||||
<< boost::log::expressions::format_date_time< boost::posix_time::ptime >("TimeStamp", "%H:%M:%S");
|
||||
date_time_formatter(view, os);
|
||||
|
||||
if(std::is_same<T,tag_console>::value)
|
||||
os<<"\033[0m";
|
||||
|
||||
os << "]"
|
||||
<< "["
|
||||
<< view.attribute_values()["Severity"].extract<custom_severity_level,T>()
|
||||
<< "] "
|
||||
//<< " - "
|
||||
<< view.attribute_values()["Message"].extract<std::string>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// helper macros
|
||||
|
||||
// global macros (core). Level filters are set globally here, that is to all register sinks
|
||||
#define LOG(severity) BOOST_LOG_SEV(global_logger::get(),custom_severity_level::severity)
|
||||
#define MQLOG(severity) BOOST_LOG_SEV(global_logger::get(),custom_severity_level::severity)
|
||||
#define SET_LOG_LEVEL(loglevel) boost::log::core::get()->set_filter(severity >= custom_severity_level::loglevel);
|
||||
#define SET_LOG_FILTER(op,loglevel) set_global_log_level(log_op::op,custom_severity_level::loglevel)
|
||||
|
||||
// local init macros (sinks)
|
||||
// Notes : when applying a filter to the sink, and then to the core, the resulting filter will
|
||||
// be the intersection of the two sets defined by the two filters, i.e., core and sinks
|
||||
// filename : path to file name without extension
|
||||
#define INIT_LOG_FILE(filename) init_log_file(filename);
|
||||
#define INIT_LOG_FILE_LVL(filename,loglevel) init_log_file(filename,custom_severity_level::loglevel);
|
||||
#define INIT_LOG_FILE_FILTER(filename,op,loglevel) init_log_file(filename,custom_severity_level::loglevel,log_op::op);
|
||||
//INIT_LOG_FILE_FILTER_MP : add id to log filename for multiprocess
|
||||
#define INIT_LOG_FILE_FILTER_MP(filename,op,loglevel,id) init_log_file(filename,custom_severity_level::loglevel,log_op::GREATER_EQ_THAN,id);
|
||||
|
||||
// create new file without formatting
|
||||
#define INIT_NEW_FILE(filename,op,loglevel) init_new_file(filename,custom_severity_level::loglevel,log_op::op);
|
||||
|
||||
|
||||
|
||||
#endif /* LOGGER_OLDBOOST_VERSION_H */
|
||||
|
|
@ -72,7 +72,8 @@ int main()
|
|||
test_set_level();
|
||||
INIT_LOG_FILE_FILTER("test_another_log_file",EQUAL,INFO);// init and add another sink to the core
|
||||
test_set_level();
|
||||
|
||||
reinit_logger(false);
|
||||
test_set_level();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,8 +68,8 @@ int FairMQProgOptions::ParseAll(const int argc, char** argv, bool allowUnregiste
|
|||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR)<<" verbosity level '"<<verbose<<"' unknown, it will be set to INFO";
|
||||
set_global_log_level(log_op::operation::GREATER_EQ_THAN,fSeverityMap.at("RESULTS"));
|
||||
LOG(ERROR)<<" verbosity level '"<<verbose<<"' unknown, it will be set to DEBUG";
|
||||
set_global_log_level(log_op::operation::GREATER_EQ_THAN,fSeverityMap.at("DEBUG"));
|
||||
}
|
||||
|
||||
PrintOptions();
|
||||
|
@ -90,7 +90,7 @@ int FairMQProgOptions::ParseAll(const int argc, char** argv, bool allowUnregiste
|
|||
|
||||
if (!optionExists)
|
||||
{
|
||||
LOG(ERROR) << "Required option to configure the MQ device is not there.";
|
||||
LOG(ERROR) << "Required options to configure the MQ device are not provided.";
|
||||
LOG(ERROR) << "Please provide the value of one of the following key:";
|
||||
for (const auto& p : MQParserKeys)
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ FairProgOptions::FairProgOptions() :
|
|||
fGenericDesc.add_options()
|
||||
("help,h", "produce help")
|
||||
("version,v", "print version")
|
||||
("verbose", po::value<std::string>(&fVerboseLvl)->default_value("INFO"), "Verbosity level : \n"
|
||||
("verbose", po::value<std::string>(&fVerboseLvl)->default_value("DEBUG"), "Verbosity level : \n"
|
||||
" TRACE \n"
|
||||
" DEBUG \n"
|
||||
" RESULTS \n"
|
||||
|
|
Loading…
Reference in New Issue
Block a user