28 #include <ndn-cxx/util/logger.hpp> 29 #include <ndn-cxx/util/logging.hpp> 34 static ndn::util::LogLevel
40 catch (
const std::invalid_argument&) {
41 NDN_THROW_NESTED(
ConfigFile::Error(
"Invalid log level for '" + key +
"' in section 'log'"));
62 auto defaultLevel = ndn::util::LogLevel::INFO;
63 auto item = section.get_child_optional(
"default_level");
69 ndn::util::Logging::setLevel(
"nfd.*", defaultLevel);
72 for (
const auto& i : section) {
73 if (i.first ==
"default_level") {
79 if (i.first.find(
'.') == std::string::npos)
81 ndn::util::Logging::setLevel(
"nfd." + i.first, level);
83 ndn::util::Logging::setLevel(i.first, level);
static ndn::util::LogLevel parseLogLevel(const ConfigSection &item, const std::string &key)
void addSectionHandler(const std::string §ionName, ConfigSectionHandler subscriber)
setup notification of configuration file sections
void setConfigFile(ConfigFile &config)
configuration file parsing utility
boost::property_tree::ptree ConfigSection
a config file section
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
static void onConfig(const ConfigSection §ion, bool isDryRun, const std::string &)