mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 18:11:49 +00:00
convert log severities use to lowercase and remove use of MQLOG
This commit is contained in:
committed by
Mohammad Al-Turany
parent
4e942e489b
commit
a3393e600e
@@ -35,8 +35,8 @@ FairMQMap ptreeToMQMap(const boost::property_tree::ptree& pt, const string& id,
|
||||
|
||||
if (channelMap.empty())
|
||||
{
|
||||
LOG(WARN) << "---- No channel keys found for " << id;
|
||||
LOG(WARN) << "---- Check the JSON inputs and/or command line inputs";
|
||||
LOG(warn) << "---- No channel keys found for " << id;
|
||||
LOG(warn) << "---- Check the JSON inputs and/or command line inputs";
|
||||
}
|
||||
|
||||
return channelMap;
|
||||
@@ -88,12 +88,12 @@ void PrintDeviceList(const boost::property_tree::ptree& tree, const string& form
|
||||
if (key != "")
|
||||
{
|
||||
deviceIdKey = key;
|
||||
LOG(DEBUG) << "Found config for device key '" << deviceIdKey << "' in JSON input";
|
||||
LOG(debug) << "Found config for device key '" << deviceIdKey << "' in JSON input";
|
||||
}
|
||||
else
|
||||
{
|
||||
deviceIdKey = q.second.get<string>("id");
|
||||
LOG(DEBUG) << "Found config for device id '" << deviceIdKey << "' in JSON input";
|
||||
LOG(debug) << "Found config for device id '" << deviceIdKey << "' in JSON input";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ void PrintDeviceList(const boost::property_tree::ptree& tree, const string& form
|
||||
if (formatFlag == "xml")
|
||||
{
|
||||
deviceIdKey = p.second.get<string>("<xmlattr>.id");
|
||||
LOG(DEBUG) << "Found config for '" << deviceIdKey << "' in XML input";
|
||||
LOG(debug) << "Found config for '" << deviceIdKey << "' in XML input";
|
||||
}
|
||||
|
||||
if (formatFlag == "json")
|
||||
@@ -113,12 +113,12 @@ void PrintDeviceList(const boost::property_tree::ptree& tree, const string& form
|
||||
if (key != "")
|
||||
{
|
||||
deviceIdKey = key;
|
||||
LOG(DEBUG) << "Found config for device key '" << deviceIdKey << "' in JSON input";
|
||||
LOG(debug) << "Found config for device key '" << deviceIdKey << "' in JSON input";
|
||||
}
|
||||
else
|
||||
{
|
||||
deviceIdKey = p.second.get<string>("id");
|
||||
LOG(DEBUG) << "Found config for device id '" << deviceIdKey << "' in JSON input";
|
||||
LOG(debug) << "Found config for device id '" << deviceIdKey << "' in JSON input";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ void DeviceParser(const boost::property_tree::ptree& tree, FairMQMap& channelMap
|
||||
{
|
||||
string deviceIdKey;
|
||||
|
||||
LOG(DEBUG) << "Looking for '" << deviceId << "' id/key in the provided config file...";
|
||||
LOG(debug) << "Looking for '" << deviceId << "' id/key in the provided config file...";
|
||||
|
||||
// For each node in fairMQOptions
|
||||
for (const auto& p : tree)
|
||||
@@ -144,12 +144,12 @@ void DeviceParser(const boost::property_tree::ptree& tree, FairMQMap& channelMap
|
||||
if (key != "")
|
||||
{
|
||||
deviceIdKey = key;
|
||||
// LOG(DEBUG) << "Found config for device key '" << deviceIdKey << "' in JSON input";
|
||||
// LOG(debug) << "Found config for device key '" << deviceIdKey << "' in JSON input";
|
||||
}
|
||||
else
|
||||
{
|
||||
deviceIdKey = q.second.get<string>("id");
|
||||
// LOG(DEBUG) << "Found config for device id '" << deviceIdKey << "' in JSON input";
|
||||
// LOG(debug) << "Found config for device id '" << deviceIdKey << "' in JSON input";
|
||||
}
|
||||
|
||||
// if not correct device id, do not fill MQMap
|
||||
@@ -158,7 +158,7 @@ void DeviceParser(const boost::property_tree::ptree& tree, FairMQMap& channelMap
|
||||
continue;
|
||||
}
|
||||
|
||||
LOG(DEBUG) << "Found with following channels:";
|
||||
LOG(debug) << "Found with following channels:";
|
||||
|
||||
ChannelParser(q.second, channelMap, formatFlag);
|
||||
}
|
||||
@@ -179,12 +179,12 @@ void DeviceParser(const boost::property_tree::ptree& tree, FairMQMap& channelMap
|
||||
if (key != "")
|
||||
{
|
||||
deviceIdKey = key;
|
||||
// LOG(DEBUG) << "Found config for device key '" << deviceIdKey << "' in JSON input";
|
||||
// LOG(debug) << "Found config for device key '" << deviceIdKey << "' in JSON input";
|
||||
}
|
||||
else
|
||||
{
|
||||
deviceIdKey = p.second.get<string>("id");
|
||||
// LOG(DEBUG) << "Found config for device id '" << deviceIdKey << "' in JSON input";
|
||||
// LOG(debug) << "Found config for device id '" << deviceIdKey << "' in JSON input";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ void DeviceParser(const boost::property_tree::ptree& tree, FairMQMap& channelMap
|
||||
continue;
|
||||
}
|
||||
|
||||
LOG(DEBUG) << "Found with following channels:";
|
||||
LOG(debug) << "Found with following channels:";
|
||||
|
||||
ChannelParser(p.second, channelMap, formatFlag);
|
||||
}
|
||||
@@ -232,19 +232,19 @@ void ChannelParser(const boost::property_tree::ptree& tree, FairMQMap& channelMa
|
||||
|
||||
if (numSockets > 0)
|
||||
{
|
||||
LOG(DEBUG) << "" << channelKey << ":";
|
||||
LOG(DEBUG) << "\tnumSockets of " << numSockets << " specified,";
|
||||
LOG(DEBUG) << "\tapplying common settings to each:";
|
||||
LOG(debug) << "" << channelKey << ":";
|
||||
LOG(debug) << "\tnumSockets of " << numSockets << " specified,";
|
||||
LOG(debug) << "\tapplying common settings to each:";
|
||||
|
||||
LOG(DEBUG) << "\ttype = " << commonChannel.GetType();
|
||||
LOG(DEBUG) << "\tmethod = " << commonChannel.GetMethod();
|
||||
LOG(DEBUG) << "\taddress = " << commonChannel.GetAddress();
|
||||
LOG(DEBUG) << "\ttransport = " << commonChannel.GetTransport();
|
||||
LOG(DEBUG) << "\tsndBufSize = " << commonChannel.GetSndBufSize();
|
||||
LOG(DEBUG) << "\trcvBufSize = " << commonChannel.GetRcvBufSize();
|
||||
LOG(DEBUG) << "\tsndKernelSize = " << commonChannel.GetSndKernelSize();
|
||||
LOG(DEBUG) << "\trcvKernelSize = " << commonChannel.GetRcvKernelSize();
|
||||
LOG(DEBUG) << "\trateLogging = " << commonChannel.GetRateLogging();
|
||||
LOG(debug) << "\ttype = " << commonChannel.GetType();
|
||||
LOG(debug) << "\tmethod = " << commonChannel.GetMethod();
|
||||
LOG(debug) << "\taddress = " << commonChannel.GetAddress();
|
||||
LOG(debug) << "\ttransport = " << commonChannel.GetTransport();
|
||||
LOG(debug) << "\tsndBufSize = " << commonChannel.GetSndBufSize();
|
||||
LOG(debug) << "\trcvBufSize = " << commonChannel.GetRcvBufSize();
|
||||
LOG(debug) << "\tsndKernelSize = " << commonChannel.GetSndKernelSize();
|
||||
LOG(debug) << "\trcvKernelSize = " << commonChannel.GetRcvKernelSize();
|
||||
LOG(debug) << "\trateLogging = " << commonChannel.GetRateLogging();
|
||||
|
||||
for (int i = 0; i < numSockets; ++i)
|
||||
{
|
||||
@@ -296,19 +296,19 @@ void ChannelParser(const boost::property_tree::ptree& tree, FairMQMap& channelMa
|
||||
|
||||
if (numSockets > 0)
|
||||
{
|
||||
LOG(DEBUG) << "" << channelKey << ":";
|
||||
LOG(DEBUG) << "\tnumSockets of " << numSockets << " specified,";
|
||||
LOG(DEBUG) << "\tapplying common settings to each:";
|
||||
LOG(debug) << "" << channelKey << ":";
|
||||
LOG(debug) << "\tnumSockets of " << numSockets << " specified,";
|
||||
LOG(debug) << "\tapplying common settings to each:";
|
||||
|
||||
LOG(DEBUG) << "\ttype = " << commonChannel.GetType();
|
||||
LOG(DEBUG) << "\tmethod = " << commonChannel.GetMethod();
|
||||
LOG(DEBUG) << "\taddress = " << commonChannel.GetAddress();
|
||||
LOG(DEBUG) << "\ttransport = " << commonChannel.GetTransport();
|
||||
LOG(DEBUG) << "\tsndBufSize = " << commonChannel.GetSndBufSize();
|
||||
LOG(DEBUG) << "\trcvBufSize = " << commonChannel.GetRcvBufSize();
|
||||
LOG(DEBUG) << "\tsndKernelSize = " << commonChannel.GetSndKernelSize();
|
||||
LOG(DEBUG) << "\trcvKernelSize = " << commonChannel.GetRcvKernelSize();
|
||||
LOG(DEBUG) << "\trateLogging = " << commonChannel.GetRateLogging();
|
||||
LOG(debug) << "\ttype = " << commonChannel.GetType();
|
||||
LOG(debug) << "\tmethod = " << commonChannel.GetMethod();
|
||||
LOG(debug) << "\taddress = " << commonChannel.GetAddress();
|
||||
LOG(debug) << "\ttransport = " << commonChannel.GetTransport();
|
||||
LOG(debug) << "\tsndBufSize = " << commonChannel.GetSndBufSize();
|
||||
LOG(debug) << "\trcvBufSize = " << commonChannel.GetRcvBufSize();
|
||||
LOG(debug) << "\tsndKernelSize = " << commonChannel.GetSndKernelSize();
|
||||
LOG(debug) << "\trcvKernelSize = " << commonChannel.GetRcvKernelSize();
|
||||
LOG(debug) << "\trateLogging = " << commonChannel.GetRateLogging();
|
||||
|
||||
for (int i = 0; i < numSockets; ++i)
|
||||
{
|
||||
@@ -351,16 +351,16 @@ void SocketParser(const boost::property_tree::ptree& tree, vector<FairMQChannel>
|
||||
channel.UpdateRcvKernelSize(q.second.get<int>("rcvKernelSize", channel.GetRcvKernelSize()));
|
||||
channel.UpdateRateLogging(q.second.get<int>("rateLogging", channel.GetRateLogging()));
|
||||
|
||||
LOG(DEBUG) << "" << channelName << "[" << socketCounter << "]:";
|
||||
LOG(DEBUG) << "\ttype = " << channel.GetType();
|
||||
LOG(DEBUG) << "\tmethod = " << channel.GetMethod();
|
||||
LOG(DEBUG) << "\taddress = " << channel.GetAddress();
|
||||
LOG(DEBUG) << "\ttransport = " << channel.GetTransport();
|
||||
LOG(DEBUG) << "\tsndBufSize = " << channel.GetSndBufSize();
|
||||
LOG(DEBUG) << "\trcvBufSize = " << channel.GetRcvBufSize();
|
||||
LOG(DEBUG) << "\tsndKernelSize = " << channel.GetSndKernelSize();
|
||||
LOG(DEBUG) << "\trcvKernelSize = " << channel.GetRcvKernelSize();
|
||||
LOG(DEBUG) << "\trateLogging = " << channel.GetRateLogging();
|
||||
LOG(debug) << "" << channelName << "[" << socketCounter << "]:";
|
||||
LOG(debug) << "\ttype = " << channel.GetType();
|
||||
LOG(debug) << "\tmethod = " << channel.GetMethod();
|
||||
LOG(debug) << "\taddress = " << channel.GetAddress();
|
||||
LOG(debug) << "\ttransport = " << channel.GetTransport();
|
||||
LOG(debug) << "\tsndBufSize = " << channel.GetSndBufSize();
|
||||
LOG(debug) << "\trcvBufSize = " << channel.GetRcvBufSize();
|
||||
LOG(debug) << "\tsndKernelSize = " << channel.GetSndKernelSize();
|
||||
LOG(debug) << "\trcvKernelSize = " << channel.GetRcvKernelSize();
|
||||
LOG(debug) << "\trateLogging = " << channel.GetRateLogging();
|
||||
|
||||
channelList.push_back(channel);
|
||||
++socketCounter;
|
||||
@@ -383,16 +383,16 @@ void SocketParser(const boost::property_tree::ptree& tree, vector<FairMQChannel>
|
||||
channel.UpdateRcvKernelSize(p.second.get<int>("rcvKernelSize", channel.GetRcvKernelSize()));
|
||||
channel.UpdateRateLogging(p.second.get<int>("rateLogging", channel.GetRateLogging()));
|
||||
|
||||
LOG(DEBUG) << "" << channelName << "[" << socketCounter << "]:";
|
||||
LOG(DEBUG) << "\ttype = " << channel.GetType();
|
||||
LOG(DEBUG) << "\tmethod = " << channel.GetMethod();
|
||||
LOG(DEBUG) << "\taddress = " << channel.GetAddress();
|
||||
LOG(DEBUG) << "\ttransport = " << channel.GetTransport();
|
||||
LOG(DEBUG) << "\tsndBufSize = " << channel.GetSndBufSize();
|
||||
LOG(DEBUG) << "\trcvBufSize = " << channel.GetRcvBufSize();
|
||||
LOG(DEBUG) << "\tsndKernelSize = " << channel.GetSndKernelSize();
|
||||
LOG(DEBUG) << "\trcvKernelSize = " << channel.GetRcvKernelSize();
|
||||
LOG(DEBUG) << "\trateLogging = " << channel.GetRateLogging();
|
||||
LOG(debug) << "" << channelName << "[" << socketCounter << "]:";
|
||||
LOG(debug) << "\ttype = " << channel.GetType();
|
||||
LOG(debug) << "\tmethod = " << channel.GetMethod();
|
||||
LOG(debug) << "\taddress = " << channel.GetAddress();
|
||||
LOG(debug) << "\ttransport = " << channel.GetTransport();
|
||||
LOG(debug) << "\tsndBufSize = " << channel.GetSndBufSize();
|
||||
LOG(debug) << "\trcvBufSize = " << channel.GetRcvBufSize();
|
||||
LOG(debug) << "\tsndKernelSize = " << channel.GetSndKernelSize();
|
||||
LOG(debug) << "\trcvKernelSize = " << channel.GetRcvKernelSize();
|
||||
LOG(debug) << "\trateLogging = " << channel.GetRateLogging();
|
||||
|
||||
channelList.push_back(channel);
|
||||
++socketCounter;
|
||||
@@ -401,25 +401,25 @@ void SocketParser(const boost::property_tree::ptree& tree, vector<FairMQChannel>
|
||||
|
||||
if (socketCounter)
|
||||
{
|
||||
LOG(DEBUG) << "Found " << socketCounter << " socket(s) in channel.";
|
||||
LOG(debug) << "Found " << socketCounter << " socket(s) in channel.";
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(DEBUG) << "" << channelName << ":";
|
||||
LOG(DEBUG) << "\tNo sockets specified,";
|
||||
LOG(DEBUG) << "\tapplying common settings to the channel:";
|
||||
LOG(debug) << "" << channelName << ":";
|
||||
LOG(debug) << "\tNo sockets specified,";
|
||||
LOG(debug) << "\tapplying common settings to the channel:";
|
||||
|
||||
FairMQChannel channel(commonChannel);
|
||||
|
||||
LOG(DEBUG) << "\ttype = " << channel.GetType();
|
||||
LOG(DEBUG) << "\tmethod = " << channel.GetMethod();
|
||||
LOG(DEBUG) << "\taddress = " << channel.GetAddress();
|
||||
LOG(DEBUG) << "\ttransport = " << channel.GetTransport();
|
||||
LOG(DEBUG) << "\tsndBufSize = " << channel.GetSndBufSize();
|
||||
LOG(DEBUG) << "\trcvBufSize = " << channel.GetRcvBufSize();
|
||||
LOG(DEBUG) << "\tsndKernelSize = " << channel.GetSndKernelSize();
|
||||
LOG(DEBUG) << "\trcvKernelSize = " << channel.GetRcvKernelSize();
|
||||
LOG(DEBUG) << "\trateLogging = " << channel.GetRateLogging();
|
||||
LOG(debug) << "\ttype = " << channel.GetType();
|
||||
LOG(debug) << "\tmethod = " << channel.GetMethod();
|
||||
LOG(debug) << "\taddress = " << channel.GetAddress();
|
||||
LOG(debug) << "\ttransport = " << channel.GetTransport();
|
||||
LOG(debug) << "\tsndBufSize = " << channel.GetSndBufSize();
|
||||
LOG(debug) << "\trcvBufSize = " << channel.GetRcvBufSize();
|
||||
LOG(debug) << "\tsndKernelSize = " << channel.GetSndKernelSize();
|
||||
LOG(debug) << "\trcvKernelSize = " << channel.GetRcvKernelSize();
|
||||
LOG(debug) << "\trateLogging = " << channel.GetRateLogging();
|
||||
|
||||
channelList.push_back(channel);
|
||||
}
|
||||
|
@@ -99,10 +99,10 @@ int FairMQProgOptions::ParseAll(const int argc, char const* const* argv, bool al
|
||||
|
||||
if (!optionExists)
|
||||
{
|
||||
LOG(WARN) << "FairMQProgOptions: no channels configuration provided via neither of:";
|
||||
LOG(warn) << "FairMQProgOptions: no channels configuration provided via neither of:";
|
||||
for (const auto& p : MQParserKeys)
|
||||
{
|
||||
LOG(WARNING) << " --" << p;
|
||||
LOG(warn) << " --" << p;
|
||||
}
|
||||
LOG(warn) << "No channels will be created (You can create them manually).";
|
||||
}
|
||||
@@ -122,7 +122,7 @@ int FairMQProgOptions::ParseAll(const int argc, char const* const* argv, bool al
|
||||
// if cmdline mq-config called then use the default xml/json parser
|
||||
if (fVarMap.count("mq-config"))
|
||||
{
|
||||
LOG(DEBUG) << "mq-config: Using default XML/JSON parser";
|
||||
LOG(debug) << "mq-config: Using default XML/JSON parser";
|
||||
|
||||
string file = fVarMap["mq-config"].as<string>();
|
||||
|
||||
@@ -149,7 +149,7 @@ int FairMQProgOptions::ParseAll(const int argc, char const* const* argv, bool al
|
||||
}
|
||||
else if (fVarMap.count("config-json-string"))
|
||||
{
|
||||
LOG(DEBUG) << "config-json-string: Parsing JSON string";
|
||||
LOG(debug) << "config-json-string: Parsing JSON string";
|
||||
|
||||
string value = FairMQ::ConvertVariableValue<FairMQ::ToString>().Run(fVarMap.at("config-json-string"));
|
||||
stringstream ss;
|
||||
@@ -158,7 +158,7 @@ int FairMQProgOptions::ParseAll(const int argc, char const* const* argv, bool al
|
||||
}
|
||||
else if (fVarMap.count("config-xml-string"))
|
||||
{
|
||||
LOG(DEBUG) << "config-json-string: Parsing XML string";
|
||||
LOG(debug) << "config-json-string: Parsing XML string";
|
||||
|
||||
string value = FairMQ::ConvertVariableValue<FairMQ::ToString>().Run(fVarMap.at("config-xml-string"));
|
||||
stringstream ss;
|
||||
@@ -167,7 +167,7 @@ int FairMQProgOptions::ParseAll(const int argc, char const* const* argv, bool al
|
||||
}
|
||||
else if (fVarMap.count(FairMQParser::SUBOPT::OptionKeyChannelConfig))
|
||||
{
|
||||
LOG(DEBUG) << "channel-config: Parsing channel configuration";
|
||||
LOG(debug) << "channel-config: Parsing channel configuration";
|
||||
UserParser<FairMQParser::SUBOPT>(fVarMap, id);
|
||||
}
|
||||
}
|
||||
@@ -325,7 +325,7 @@ int FairMQProgOptions::UpdateChannelMap(const string& channelName, int index, co
|
||||
else
|
||||
{
|
||||
//if we get there it means something is wrong
|
||||
LOG(ERROR) << "update of FairMQChannel map failed for the following key: "
|
||||
LOG(error) << "update of FairMQChannel map failed for the following key: "
|
||||
<< channelName << "." << index << "." << member;
|
||||
return 1;
|
||||
}
|
||||
@@ -353,7 +353,7 @@ int FairMQProgOptions::UpdateChannelMap(const string& channelName, int index, co
|
||||
else
|
||||
{
|
||||
// if we get there it means something is wrong
|
||||
LOG(ERROR) << "update of FairMQChannel map failed for the following key: " << channelName << "." << index << "." << member;
|
||||
LOG(error) << "update of FairMQChannel map failed for the following key: " << channelName << "." << index << "." << member;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@@ -62,7 +62,7 @@ class FairMQProgOptions : public FairProgOptions
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
LOG(ERROR) << e.what();
|
||||
LOG(error) << e.what();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@@ -64,7 +64,7 @@ FairMQMap SUBOPT::UserParser(const po::variables_map& omap, const std::string& d
|
||||
else
|
||||
{
|
||||
// TODO: what is the error policy here, should we abort?
|
||||
LOG(ERROR) << "missing channel name in argument of option --channel-config";
|
||||
LOG(error) << "missing channel name in argument of option --channel-config";
|
||||
}
|
||||
}
|
||||
for (auto channelProperty : channelProperties)
|
||||
|
@@ -195,7 +195,7 @@ int FairProgOptions::PrintOptions()
|
||||
}
|
||||
ss << setfill ('*') << setw(totalLength + 3) << "*";// +3 for " = "
|
||||
|
||||
LOG(DEBUG) << ss.str();
|
||||
LOG(debug) << ss.str();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -98,7 +98,7 @@ class FairProgOptions
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "Config has no key: " << key;
|
||||
LOG(error) << "Config has no key: " << key;
|
||||
}
|
||||
}
|
||||
catch (std::exception& e)
|
||||
@@ -125,8 +125,8 @@ class FairProgOptions
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
LOG(ERROR) << "Exception thrown for the key '" << key << "'";
|
||||
LOG(ERROR) << e.what();
|
||||
LOG(error) << "Exception thrown for the key '" << key << "'";
|
||||
LOG(error) << e.what();
|
||||
}
|
||||
|
||||
return valueStr;
|
||||
@@ -152,7 +152,7 @@ class FairProgOptions
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "the provided string " << strValue << " cannot be converted in the requested type. The target types must be arithmetic types";
|
||||
LOG(error) << "the provided string " << strValue << " cannot be converted in the requested type. The target types must be arithmetic types";
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -68,8 +68,8 @@ int main(int argc, char** argv)
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
LOG(ERROR) << e.what();
|
||||
LOG(INFO) << "Command line options are the following : ";
|
||||
LOG(error) << e.what();
|
||||
LOG(info) << "Command line options are the following : ";
|
||||
config.PrintHelp();
|
||||
return 1;
|
||||
}
|
||||
|
@@ -62,8 +62,8 @@ int main(int argc, char** argv)
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
LOG(ERROR) << e.what();
|
||||
LOG(INFO) << "Command line options are the following : ";
|
||||
LOG(error) << e.what();
|
||||
LOG(info) << "Command line options are the following : ";
|
||||
config.PrintHelp();
|
||||
return 1;
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@
|
||||
// Parse xml from file
|
||||
int testXML1(FairMQProgOptions* config)
|
||||
{
|
||||
LOG(INFO)<<"--------- test XML1 ---------\n";
|
||||
LOG(info)<<"--------- test XML1 ---------\n";
|
||||
std::string filename;
|
||||
std::string XMLrootNode;
|
||||
|
||||
@@ -25,14 +25,14 @@ int testXML1(FairMQProgOptions* config)
|
||||
config->UserParser<FairMQParser::MQXML2>(filename);
|
||||
config->UserParser<FairMQParser::MQXML3>(filename,"merger");
|
||||
|
||||
LOG(INFO)<<"--------- test XML1 end ---------\n";
|
||||
LOG(info)<<"--------- test XML1 end ---------\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Parse xml from command line
|
||||
int testXML2(FairMQProgOptions* config)
|
||||
{
|
||||
LOG(INFO)<<"--------- test XML2 ---------\n";
|
||||
LOG(info)<<"--------- test XML2 ---------\n";
|
||||
std::string XML;
|
||||
std::string XMLrootNode;
|
||||
std::string id=config->GetValue<std::string>("id");
|
||||
@@ -45,14 +45,14 @@ int testXML2(FairMQProgOptions* config)
|
||||
iss << XML;
|
||||
config->UserParser<FairMQParser::XML>(iss,id,XMLrootNode);
|
||||
|
||||
LOG(INFO)<<"--------- test XML2 end ---------\n";
|
||||
LOG(info)<<"--------- test XML2 end ---------\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Parse json from file
|
||||
int testJSON1(FairMQProgOptions* config)
|
||||
{
|
||||
LOG(INFO)<<"--------- test JSON1 ---------\n";
|
||||
LOG(info)<<"--------- test JSON1 ---------\n";
|
||||
std::string filename;
|
||||
std::string JSONrootNode;
|
||||
std::string id=config->GetValue<std::string>("id");
|
||||
@@ -62,14 +62,14 @@ int testJSON1(FairMQProgOptions* config)
|
||||
|
||||
config->UserParser<FairMQParser::JSON>(filename,id,JSONrootNode);
|
||||
|
||||
LOG(INFO)<<"--------- test JSON1 end ---------\n";
|
||||
LOG(info)<<"--------- test JSON1 end ---------\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Parse json from command line
|
||||
int testJSON2(FairMQProgOptions* config)
|
||||
{
|
||||
LOG(INFO)<<"--------- test JSON2 ---------\n";
|
||||
LOG(info)<<"--------- test JSON2 ---------\n";
|
||||
std::string JSON;
|
||||
std::string JSONrootNode;
|
||||
std::string id=config->GetValue<std::string>("id");
|
||||
@@ -82,7 +82,7 @@ int testJSON2(FairMQProgOptions* config)
|
||||
iss << JSON;
|
||||
config->UserParser<FairMQParser::JSON>(iss,id,JSONrootNode);
|
||||
|
||||
LOG(INFO)<<"--------- test JSON2 end ---------\n";
|
||||
LOG(info)<<"--------- test JSON2 end ---------\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
LOG(ERROR) << e.what();
|
||||
LOG(error) << e.what();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@@ -62,7 +62,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
MQLOG(ERROR) << e.what();
|
||||
LOG(error) << e.what();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@@ -46,7 +46,7 @@ class MyDevice : public FairMQDevice
|
||||
|
||||
void Print()
|
||||
{
|
||||
LOG(INFO) << "[MyDevice] rate = " << fRate;
|
||||
LOG(info) << "[MyDevice] rate = " << fRate;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -96,61 +96,61 @@ int main(int argc, char** argv)
|
||||
|
||||
// string dataRateStr = config.GetStringValue("data-rate");
|
||||
// double dataRate = config.ConvertTo<double>(dataRateStr);
|
||||
// LOG(INFO) << "dataRate: " << dataRate;
|
||||
// LOG(info) << "dataRate: " << dataRate;
|
||||
|
||||
LOG(INFO) << "Subscribing: <string>(chans.data.0.address)";
|
||||
LOG(info) << "Subscribing: <string>(chans.data.0.address)";
|
||||
config.Subscribe<string>("test", [&device](const string& key, string value)
|
||||
{
|
||||
if (key == "chans.data.0.address")
|
||||
{
|
||||
LOG(INFO) << "[callback] Updating device parameter " << key << " = " << value;
|
||||
LOG(info) << "[callback] Updating device parameter " << key << " = " << value;
|
||||
device.fChannels.at("data").at(0).UpdateAddress(value);
|
||||
}
|
||||
});
|
||||
|
||||
LOG(INFO) << "Subscribing: <int>(chans.data.0.rcvBufSize)";
|
||||
LOG(info) << "Subscribing: <int>(chans.data.0.rcvBufSize)";
|
||||
config.Subscribe<int>("test", [&device](const string& key, int value)
|
||||
{
|
||||
if(key == "chans.data.0.rcvBufSize")
|
||||
{
|
||||
LOG(INFO) << "[callback] Updating device parameter " << key << " = " << value;
|
||||
LOG(info) << "[callback] Updating device parameter " << key << " = " << value;
|
||||
device.fChannels.at("data").at(0).UpdateRcvBufSize(value);
|
||||
}
|
||||
});
|
||||
|
||||
LOG(INFO) << "Subscribing: <double>(data-rate)";
|
||||
LOG(info) << "Subscribing: <double>(data-rate)";
|
||||
config.Subscribe<double>("test", [&device](const string& key, double value)
|
||||
{
|
||||
if (key == "data-rate")
|
||||
{
|
||||
LOG(INFO) << "[callback] Updating device parameter " << key << " = " << value;
|
||||
LOG(info) << "[callback] Updating device parameter " << key << " = " << value;
|
||||
device.SetRate(value);
|
||||
}
|
||||
});
|
||||
|
||||
LOG(INFO) << "Starting value updates...\n";
|
||||
LOG(info) << "Starting value updates...\n";
|
||||
|
||||
config.UpdateValue<string>("chans.data.0.address", "tcp://localhost:4321");
|
||||
LOG(INFO) << "config: " << config.GetValue<string>("chans.data.0.address");
|
||||
LOG(INFO) << "device: " << device.fChannels.at("data").at(0).GetAddress() << endl;
|
||||
LOG(info) << "config: " << config.GetValue<string>("chans.data.0.address");
|
||||
LOG(info) << "device: " << device.fChannels.at("data").at(0).GetAddress() << endl;
|
||||
|
||||
config.UpdateValue<int>("chans.data.0.rcvBufSize", 100);
|
||||
LOG(INFO) << "config: " << config.GetValue<int>("chans.data.0.rcvBufSize");
|
||||
LOG(INFO) << "device: " << device.fChannels.at("data").at(0).GetRcvBufSize() << endl;
|
||||
LOG(info) << "config: " << config.GetValue<int>("chans.data.0.rcvBufSize");
|
||||
LOG(info) << "device: " << device.fChannels.at("data").at(0).GetRcvBufSize() << endl;
|
||||
|
||||
config.UpdateValue<double>("data-rate", 0.9);
|
||||
LOG(INFO) << "config: " << config.GetValue<double>("data-rate");
|
||||
LOG(INFO) << "device: " << device.GetRate() << endl;
|
||||
LOG(info) << "config: " << config.GetValue<double>("data-rate");
|
||||
LOG(info) << "device: " << device.GetRate() << endl;
|
||||
// device.Print();
|
||||
|
||||
LOG(INFO) << "nase: " << config.GetValue<double>("nase");
|
||||
LOG(info) << "nase: " << config.GetValue<double>("nase");
|
||||
|
||||
config.Unsubscribe<string>("test");
|
||||
config.Unsubscribe<int>("test");
|
||||
config.Unsubscribe<double>("test");
|
||||
// advanced commands
|
||||
|
||||
// LOG(INFO) << "-------------------- start custom 1";
|
||||
// LOG(info) << "-------------------- start custom 1";
|
||||
|
||||
// config.Connect<EventId::Custom, MyDevice&, double>("myNewKey", [](MyDevice& d, double val)
|
||||
// {
|
||||
@@ -160,14 +160,14 @@ int main(int argc, char** argv)
|
||||
|
||||
// config.Emit<EventId::Custom, MyDevice&, double>("myNewKey", device, 0.123);
|
||||
|
||||
// LOG(INFO) << "-------------------- start custom 2 with function";
|
||||
// LOG(info) << "-------------------- start custom 2 with function";
|
||||
// config.Connect<EventId::Custom, MyDevice&, double>("function example", &MyCallBack);
|
||||
|
||||
// config.Emit<EventId::Custom, MyDevice&, double>("function example", device, 6.66);
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
LOG(ERROR) << "Unhandled Exception reached the top of main: "
|
||||
LOG(error) << "Unhandled Exception reached the top of main: "
|
||||
<< e.what() << ", application will now exit";
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user