diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-03-01 22:54:56 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-03-01 22:54:56 +0000 |
commit | 69bb86cd6a6ca5f914b8d35bb42501f2b73377d0 (patch) | |
tree | 2da6a7b530e68469eb44a8dfed44cfaa0a67d3c5 /lib/common/Logging.h | |
parent | ac8a5801e74636086108276dce7f15a4c1951728 (diff) |
Add support for logging just to syslog (not console) at a given
priority.
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; } |