26 #ifndef NFD_CORE_LOGGER_FACTORY_HPP 27 #define NFD_CORE_LOGGER_FACTORY_HPP 31 #ifdef HAVE_CUSTOM_LOGGER 32 #include "custom-logger-factory.hpp" 46 class Error :
public std::runtime_error
51 :
std::runtime_error(error)
65 std::list<std::string>
69 create(
const std::string& moduleName);
77 getDefaultLevel()
const;
92 createLogger(
const std::string& moduleName);
95 parseLevel(
const std::string& level);
98 extractLevel(
const ConfigSection& item,
const std::string& key);
102 typedef std::map<std::string, LogLevel> LevelMap;
103 typedef std::pair<std::string, LogLevel> NameAndLevel;
105 LevelMap m_levelNames;
107 typedef std::map<std::string, Logger> LoggerMap;
108 typedef std::pair<std::string, Logger> NameAndLogger;
111 mutable std::mutex m_loggersGuard;
117 LoggerFactory::getDefaultLevel()
const 119 return m_defaultLevel;
124 #endif // HAVE_CUSTOM_LOGGER 126 #endif // NFD_CORE_LOGGER_FACTORY_HPP
configuration file parsing utility
void setConfigFile(ConfigFile &config)
void onConfig(const ConfigSection §ion, bool isDryRun, const std::string &filename)
static LoggerFactory & getInstance()
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
boost::property_tree::ptree ConfigSection
a config file section
static Logger & create(const std::string &moduleName)
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
LogLevel
indicates a log level
provides logging for a module
Error(const std::string &error)
std::list< std::string > getModules() const