8 #define LOG4CPP_FIX_ERROR_COLLISION 1
9 #include <log4cpp/Category.hh>
10 #include <log4cpp/FileAppender.hh>
11 #include <log4cpp/PatternLayout.hh>
12 #include <log4cpp/OstreamAppender.hh>
69 #define _SET_COLOR(a) "\033[" a
70 #define _RESET_COLOR() "\033[0m"
72 #define _SET_COLOR(a) ""
73 #define _RESET_COLOR() ""
77 #define LOG(a) (TraceSystem::logStream() << a << log4cpp::eol)
78 #define LOGC(c, a) (TraceSystem::logStream() << _SET_COLOR(c) << a << _RESET_COLOR() << log4cpp::eol)
79 #define ERROR(a) (TraceSystem::errorStream() << _SET_COLOR(_RED) << __FILE__ << ":" << __LINE__ << ": ERROR: " << a << _RESET_COLOR() << log4cpp::eol)
86 #if defined(SHOW_TRACES) && !defined(NDEBUG) && !defined(SILENT_MODE)
87 #define TRACE(a) (TraceSystem::traceStream() << _SET_COLOR(_YELLOW) << __FILE__ << ":" << __LINE__ << ": TRACE: " << a << _RESET_COLOR() << log4cpp::eol)
92 #define CERR(a) (cerr << _SET_COLOR(_RED) << a << "!" << _RESET_COLOR() << endl, -1)
log4cpp::Appender * appender
Definition: trace.h:23
static TraceSystem traceSystem
Definition: trace.h:28
static log4cpp::CategoryStream errorStream()
Definition: trace.h:51
static bool AppendToFile(const char *name)
Definition: trace.h:36
static bool AppendToFile(const std::string &name)
Definition: trace.h:41
log4cpp::Appender * file_appender
Definition: trace.h:25
bool AppendToFile_(const char *name)
Definition: trace.cc:27
TraceSystem()
Definition: trace.cc:10
Wrapper used by the application to handle the log/trace messages by means of the log4cpp library...
Definition: trace.h:19
static log4cpp::CategoryStream logStream()
Definition: trace.h:46
log4cpp::PatternLayout * layout
Definition: trace.h:24
virtual ~TraceSystem()
Definition: trace.cc:64
log4cpp::PatternLayout * file_layout
Definition: trace.h:26
log4cpp::Category * category
Definition: trace.h:22
static log4cpp::CategoryStream traceStream()
Definition: trace.h:56