diff options
Diffstat (limited to 'lib/common/Logging.h')
-rw-r--r-- | lib/common/Logging.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/common/Logging.h b/lib/common/Logging.h index 2d726627..2d09b319 100644 --- a/lib/common/Logging.h +++ b/lib/common/Logging.h @@ -48,6 +48,20 @@ if (Logging::IsEnabled(Log::TRACE)) \ { BOX_LOG(Log::TRACE, stuff) } +#define BOX_LOG_SYS_WARNING(stuff) \ + BOX_WARNING(stuff << ": " << strerror(errno) << " (" << errno << ")") +#define BOX_LOG_SYS_ERROR(stuff) \ + BOX_ERROR(stuff << ": " << strerror(errno) << " (" << errno << ")") +#define BOX_LOG_SYS_FATAL(stuff) \ + BOX_FATAL(stuff << ": " << strerror(errno) << " (" << errno << ")") + +#ifdef WIN32 + #define BOX_LOG_WIN_ERROR(stuff) \ + BOX_ERROR(stuff << ": " << GetErrorMessage(GetLastError())) + #define BOX_LOG_WIN_ERROR_NUMBER(stuff, number) \ + BOX_ERROR(stuff << ": " << GetErrorMessage(number)) +#endif + #define BOX_FORMAT_ACCOUNT(accno) \ std::hex << \ std::showbase << \ |