10 #ifndef WRENCH_S4U_COLORLOGGING_H
11 #define WRENCH_S4U_COLORLOGGING_H
15 #include <simgrid/s4u/Actor.hpp>
27 #define WRENCH_LOG_CATEGORY(cname, desc) XBT_LOG_NEW_DEFAULT_CATEGORY(cname, desc)
29 #define WRENCH_INFO(...); \
30 if (_XBT_LOG_ISENABLEDV((*_simgrid_log_category__default), xbt_log_priority_info)) { \
31 wrench::TerminalOutput::beginThisProcessColor(); \
32 XBT_INFO(__VA_ARGS__) ; \
33 wrench::TerminalOutput::endThisProcessColor(); \
36 #define WRENCH_DEBUG(...); \
37 if (_XBT_LOG_ISENABLEDV((*_simgrid_log_category__default), xbt_log_priority_debug)) { \
38 wrench::TerminalOutput::beginThisProcessColor(); \
39 XBT_DEBUG(__VA_ARGS__) ; \
40 wrench::TerminalOutput::endThisProcessColor(); \
43 #define WRENCH_WARN(...); \
44 if (_XBT_LOG_ISENABLEDV((*_simgrid_log_category__default), xbt_log_priority_warning)) { \
45 wrench::TerminalOutput::beginThisProcessColor(); \
46 XBT_WARN(__VA_ARGS__) ; \
47 wrench::TerminalOutput::endThisProcessColor(); \
89 static void beginThisProcessColor();
91 static void endThisProcessColor();
93 static void disableColor();
103 static const char * color_codes[];
105 static std::map<simgrid::s4u::Actor *, std::string> colormap;
107 static std::string getThisProcessLoggingColor();
109 static bool color_enabled;
119 #endif //WRENCH_S4U_COLORLOGGING_H
static void setThisProcessLoggingColor(Color color)
Set the color of log messages printed to the terminal.
Definition: TerminalOutput.cpp:36
@ COLOR_CYAN
Cyan text.
Definition: TerminalOutput.h:76
@ COLOR_GREEN
Green text.
Definition: TerminalOutput.h:68
Color
Terminal output color enum.
Definition: TerminalOutput.h:62
@ COLOR_RED
Red text.
Definition: TerminalOutput.h:66
@ COLOR_WHITE
White text.
Definition: TerminalOutput.h:78
@ COLOR_BLACK
Black text.
Definition: TerminalOutput.h:64
@ COLOR_YELLOW
Yellow text.
Definition: TerminalOutput.h:70
Color-enabling wrappers around Simgrid's XBT_INFO, XBT_DEBUG, XBT_WARN logging macros.
Definition: TerminalOutput.h:57
@ COLOR_MAGENTA
Magenta text.
Definition: TerminalOutput.h:74
@ COLOR_BLUE
Blue text.
Definition: TerminalOutput.h:72