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(); \
94 static void disableLog();
102 static const char * color_codes[];
104 static std::map<simgrid::s4u::Actor *, std::string> colormap;
106 static std::string getThisProcessLoggingColor();
108 static bool color_enabled;
118 #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
static void disableColor()
Disable color terminal output for all processes.
Definition: TerminalOutput.cpp:62
@ 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
static void beginThisProcessColor()
Turn on colored output for the calling process.
Definition: TerminalOutput.cpp:43
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
static void endThisProcessColor()
Turn off colored output for the calling process.
Definition: TerminalOutput.cpp:53
@ COLOR_BLUE
Blue text.
Definition: TerminalOutput.h:72