libcamgm
Namespaces | Macros | Enumerations | Functions
Logger.hpp File Reference
#include <iosfwd>
#include <cstring>
#include <ca-mgm/String.hpp>

Go to the source code of this file.

Namespaces

 ca_mgm
 
 ca_mgm::logger
 

Macros

#define CA_MGM_LOGGER_LOGGROUP   "ca_mgm"
 
#define DBG   _DBG( CA_MGM_LOGGER_LOGGROUP )
 
#define INF   _INF( CA_MGM_LOGGER_LOGGROUP )
 
#define WAR   _WAR( CA_MGM_LOGGER_LOGGROUP )
 
#define ERR   _ERR( CA_MGM_LOGGER_LOGGROUP )
 
#define FAT   _FAT( CA_MGM_LOGGER_LOGGROUP )
 
#define _DBG(GROUP)   CA_MGM_LOGGER_LOG( GROUP, ca_mgm::logger::E_DEBUG )
 
#define _INF(GROUP)   CA_MGM_LOGGER_LOG( GROUP, ca_mgm::logger::E_INFO )
 
#define _WAR(GROUP)   CA_MGM_LOGGER_LOG( GROUP, ca_mgm::logger::E_WARN )
 
#define _ERR(GROUP)   CA_MGM_LOGGER_LOG( GROUP, ca_mgm::logger::E_ERROR )
 
#define _FAT(GROUP)   CA_MGM_LOGGER_LOG( GROUP, ca_mgm::logger::E_FATAL )
 
#define _BASEFILE   ( *__FILE__ == '/' ? strrchr( __FILE__, '/' ) + 1 : __FILE__ )
 
#define CA_MGM_LOGGER_LOG(GROUP, LEVEL)   ca_mgm::logger::getStream( GROUP, LEVEL, _BASEFILE, __FUNCTION__, __LINE__ )
 

Enumerations

enum  ca_mgm::logger::LogLevel {
  ca_mgm::logger::E_FATAL = 1, ca_mgm::logger::E_ERROR = 2, ca_mgm::logger::E_WARN = 3, ca_mgm::logger::E_INFO = 4,
  ca_mgm::logger::E_DEBUG = 5
}
 

Functions

std::string ca_mgm::logger::logLevelToString (LogLevel level_r)
 
std::ostream & ca_mgm::logger::getStream (const char *group_r, LogLevel level_r, const char *file_r, const char *func_r, const int line_r)
 
bool ca_mgm::logger::isEnabledFor (LogLevel level_r)
 
void ca_mgm::logger::setLogLevel (LogLevel level_r)