mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
add a command line to enable/disable the color format in the fairmq log console output
This commit is contained in:
@@ -61,6 +61,9 @@ int FairMQProgOptions::ParseAll(const int argc, char** argv, bool allowUnregiste
|
||||
|
||||
// set log level before printing (default is 0 = DEBUG level)
|
||||
std::string verbose=GetValue<std::string>("verbose");
|
||||
bool color_format=GetValue<bool>("log-color-format");
|
||||
if(!color_format)
|
||||
reinit_logger(false);
|
||||
//SET_LOG_LEVEL(DEBUG);
|
||||
if (fSeverityMap.count(verbose))
|
||||
{
|
||||
|
@@ -42,6 +42,7 @@ FairProgOptions::FairProgOptions() :
|
||||
" STATE \n"
|
||||
" NOLOG"
|
||||
)
|
||||
("log-color-format", po::value<bool>()->default_value(true), "logger color format : true or false")
|
||||
;
|
||||
|
||||
fSeverityMap["TRACE"] = fairmq::severity_level::TRACE;
|
||||
|
@@ -210,10 +210,17 @@ namespace fairmq
|
||||
if (is_this_type<std::size_t>(varValue))
|
||||
return T::template Value<std::size_t>(varValue,std::string(" [Type=std::size_t]"),defaultedValue,emptyValue);
|
||||
|
||||
// std::vector short
|
||||
// std::vector size_t
|
||||
if (is_this_type<std::vector<std::size_t>>(varValue))
|
||||
return T::template Value<std::vector<std::size_t>>(varValue,std::string(" [Type=vector<std::size_t>]"),defaultedValue,emptyValue);
|
||||
|
||||
// bool
|
||||
if (is_this_type<bool>(varValue))
|
||||
return T::template Value<bool>(varValue,std::string(" [Type=bool]"),defaultedValue,emptyValue);
|
||||
|
||||
// std::vector bool
|
||||
if (is_this_type<std::vector<bool>>(varValue))
|
||||
return T::template Value<std::vector<bool>>(varValue,std::string(" [Type=vector<bool>]"),defaultedValue,emptyValue);
|
||||
|
||||
//////////////////////////////// boost types
|
||||
// boost::filesystem::path
|
||||
|
Reference in New Issue
Block a user