diff options
Diffstat (limited to 'lib/common/Logging.h')
-rw-r--r-- | lib/common/Logging.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/common/Logging.h b/lib/common/Logging.h index 21c23a7e..2d726627 100644 --- a/lib/common/Logging.h +++ b/lib/common/Logging.h @@ -32,6 +32,13 @@ Logging::Log(level, __FILE__, __LINE__, line.str()); \ } +#define BOX_SYSLOG(level, stuff) \ +{ \ + std::ostringstream line; \ + line << stuff; \ + Logging::LogToSyslog(level, __FILE__, __LINE__, line.str()); \ +} + #define BOX_FATAL(stuff) BOX_LOG(Log::FATAL, stuff) #define BOX_ERROR(stuff) BOX_LOG(Log::ERROR, stuff) #define BOX_WARNING(stuff) BOX_LOG(Log::WARNING, stuff) @@ -196,6 +203,8 @@ class Logging static void Remove (Logger* pOldLogger); static void Log(Log::Level level, const std::string& rFile, int line, const std::string& rMessage); + static void LogToSyslog(Log::Level level, const std::string& rFile, + int line, const std::string& rMessage); static void SetContext(std::string context); static void ClearContext(); static void SetGlobalLevel(Log::Level level) { sGlobalLevel = level; } |