logger.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
30 #ifndef NLSR_LOGGER_HPP
31 #define NLSR_LOGGER_HPP
32 
33 #include <log4cxx/logger.h>
34 
35 #define INIT_LOGGER(name) \
36  static log4cxx::LoggerPtr staticModuleLogger = log4cxx::Logger::getLogger(name)
37 
38 #define NLSR_LOG_TRACE(x) \
39  LOG4CXX_TRACE(staticModuleLogger, x)
40 
41 #define NLSR_LOG_DEBUG(x) \
42  LOG4CXX_DEBUG(staticModuleLogger, x)
43 
44 #define NLSR_LOG_INFO(x) \
45  LOG4CXX_INFO(staticModuleLogger, x)
46 
47 #define NLSR_LOG_WARN(x) \
48  LOG4CXX_WARN(staticModuleLogger, x)
49 
50 #define NLSR_LOG_ERROR(x) \
51  LOG4CXX_ERROR(staticModuleLogger, x)
52 
53 #define NLSR_LOG_FATAL(x) \
54  LOG4CXX_FATAL(staticModuleLogger, x);
55 
56 void
57 INIT_LOGGERS(const std::string& logDir, const std::string& logLevel);
58 
59 void
60 INIT_LOG4CXX(const std::string& log4cxxConfPath);
61 
62 bool
63 isValidLogLevel(const std::string& logLevel);
64 
65 #endif // NLSR_LOGGER_HPP
void INIT_LOGGERS(const std::string &logDir, const std::string &logLevel)
Definition: logger.cpp:47
bool isValidLogLevel(const std::string &logLevel)
Definition: logger.cpp:80
void INIT_LOG4CXX(const std::string &log4cxxConfPath)
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California.
Definition: logger.cpp:36