22 #ifndef NDN_CXX_UTIL_LOGGING_HPP 
   23 #define NDN_CXX_UTIL_LOGGING_HPP 
   27 #ifdef HAVE_NDN_CXX_CUSTOM_LOGGER 
   28 #include "ndn-cxx/util/custom-logging.hpp" 
   31 #include <boost/log/sinks.hpp> 
   33 #include <unordered_map> 
   51   static std::set<std::string>
 
   95   setDestination(boost::shared_ptr<boost::log::sinks::sink> destination);
 
  117   static boost::shared_ptr<boost::log::sinks::sink>
 
  124   addLoggerImpl(
Logger& logger);
 
  127   registerLoggerNameImpl(std::string name);
 
  129   std::set<std::string>
 
  130   getLoggerNamesImpl() 
const;
 
  145   findLevel(std::string moduleName) 
const;
 
  148   setLevelImpl(
const std::string& prefix, 
LogLevel level);
 
  151   setLevelImpl(
const std::string& config);
 
  154   setDestinationImpl(boost::shared_ptr<boost::log::sinks::sink> sink);
 
  163 #ifdef NDN_CXX_HAVE_TESTS 
  165   removeLogger(
Logger& logger);
 
  170   boost::shared_ptr<boost::log::sinks::sink>
 
  171   getDestination() 
const;
 
  174   setLevelImpl(
const std::unordered_map<std::string, LogLevel>& prefixRules);
 
  176   const std::unordered_map<std::string, LogLevel>&
 
  183   mutable std::mutex m_mutex;
 
  184   std::unordered_map<std::string, LogLevel> m_enabledLevel; 
 
  185   std::unordered_multimap<std::string, Logger*> m_loggers; 
 
  187   boost::shared_ptr<boost::log::sinks::sink> m_destination;
 
  190 inline std::set<std::string>
 
  193   return get().getLoggerNamesImpl();
 
  199   get().setLevelImpl(prefix, level);
 
  205   get().setLevelImpl(config);
 
  211   get().setDestinationImpl(std::move(destination));
 
Represents a log module in the logging facility.
 
Controls the logging facility.
 
static void flush()
Flush log backend.
 
static void setLevel(const std::string &prefix, LogLevel level)
Set severity level.
 
static void setDestination(boost::shared_ptr< boost::log::sinks::sink > destination)
Set or replace log destination.
 
static std::set< std::string > getLoggerNames()
Get list of all registered logger names.
 
static boost::shared_ptr< boost::log::sinks::sink > makeDefaultStreamDestination(shared_ptr< std::ostream > os, bool wantAutoFlush=true)
Create stream log destination using default formatting.
 
Common includes and macros used throughout the library.
 
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
 
LogLevel
Indicates the severity level of a log message.