add a command line to enable/disable the color format in the fairmq log console output

This commit is contained in:
NicolasWinckler
2015-11-20 15:25:34 +01:00
parent 10d6482716
commit 35c64c67a2
5 changed files with 16 additions and 3 deletions

View File

@@ -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))
{

View File

@@ -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;

View File

@@ -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