![]() |
Home | Libraries | Author | Links |
![]() |
These facilities are used throughout the other SysToMath Aids C++ Library modules.
Files | |
file | debugaids.hpp |
Definition of debugging support macros and functions. | |
Defines | |
#define | StmDebugAidsErrmsg(msg) StmDebugAidsErrmsgImpl_ (msg) |
Return the error message msg as std::string. | |
#define | StmDebugAidsVerify(cond) StmDebugAidsVerifyImpl_ (cond) |
Verify that the boolean condition cond is true. | |
Enumerations | |
enum | stm::SyslogFlags { stm::SyslogNoLog = 0x00000000, stm::SyslogInfo = 0x00000001, stm::LogInfo = 0x00000001, stm::SyslogWarning = 0x00000002, stm::LogWarning = 0x00000002, stm::SyslogError = 0x00000003, stm::LogError = 0x00000003, stm::SyslogLevelMask = 0x00000003, stm::LogLevelMask = 0x00000003, stm::SyslogPerror = 0x00010000, stm::LogPerror = 0x00010000, stm::SyslogNoPerror = 0x00020000, stm::LogNoPerror = 0x00020000 } |
Syslog flags. More... | |
Functions | |
void | stm::initSyslog (bool perror=false, const std::string &prog=std::string()) |
Initialize syslog(). | |
void | stm::syslog (const std::string &message, unsigned int flags=SyslogInfo) |
Output message to the system log according to flags. |
#define StmDebugAidsErrmsg | ( | msg | ) | StmDebugAidsErrmsgImpl_ (msg) |
Return the error message msg as std::string.
If the macro NDEBUG
in not defined, that error message is preceded by the filename and line number of the invocation location. For conveniance inside msg std::ostringstream::operator<<() may be used.
Definition at line 94 of file debugaids.hpp.
Verify that the boolean condition cond is true.
If the macro NDEBUG
is defined or cond is true, the macro does nothing.
Else if cond is false, a dialog box pops up prompting for the action to be done offering the choice of ignoring the situation or of throwing a std::logic_error exception with cond as text.
On Windows systems, moreover, there is a choice to enter the debugger.
Definition at line 106 of file debugaids.hpp.
Referenced by main().
enum stm::SyslogFlags |
Syslog flags.
SyslogNoLog | No logging. |
SyslogInfo | Information log level. |
LogInfo |
|
SyslogWarning | Warning log level. |
LogWarning |
|
SyslogError | Error log level. |
LogError |
|
SyslogLevelMask | Log level mask. |
LogLevelMask |
|
SyslogPerror | If set, print to stderr as well. |
LogPerror |
|
SyslogNoPerror | If set, do not print to stderr as well. |
LogNoPerror |
|
Definition at line 120 of file debugaids.hpp.
void stm::initSyslog | ( | bool | perror = false , |
|
const std::string & | prog = std::string() | |||
) |
void stm::syslog | ( | const std::string & | message, | |
unsigned int | flags = SyslogInfo | |||
) |
Output message to the system log according to flags.
If flags contains the SyslogPerror flag or initSyslog() was called with perror set, message is also output on stderr.
© Copyright Tom Michaelis 2002-2007
Distributed under the SysToMath Software License (See the accompanying file license.txt or a copy at www.SysToMath.com).