#include <fstream>
#include <ostream>
#include <string>
#include "defs.h"
#include "mutex.h"
#include <cstdlib>
Namespaces | |
namespace | iopc |
Classes | |
class | iopc::LogWriter |
A LogWriter singleton is used to log messages for the IOPC 2 library or user application. More... |
IOPC_DEBUG macro enables or disables all debugging messages IOPC_TRACE macro enables or disables all tracing messages. Release versions of IOPC 2 should have these macros undefined.
The logging macros can be used in the following way:
IOPC_DEBUG macros (if IOPC_DEBUG is undefined, no messages are logged): IOPC_DEBUGLOG(msg) IOPC_TRACE macros (if IOPC_TRACE is undefined, no messages are logged): void func() { IOPC_FUNC_INVOKED; .. IOPC_FUNC_ENDED; or IOPC_FUNC_END(string retval) } IOPC_LOG_THROW(IopcDbException("error")) IOPC_LOG_CATCH(IopcException& exc) IOPC_LOG_THROW(exc); IOPC_LOG_CATCH_NEXT(...) IOPC_UNREACHABLE; IOPC_LOG_CAUGHT Always logging macros: IOPC_ASSERT(cond); // Exits program if condition evaluates to false IOPC_UNREACHABLE; // Exists program if reached