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(); \
57 class TerminalOutput {
81 static void setThisProcessLoggingColor(Color color);
89 static void beginThisProcessColor();
91 static void endThisProcessColor();
93 static void disableColor();
103 static const char * color_codes[];
105 static std::unordered_map<simgrid::s4u::Actor *, std::string> colormap;
107 static std::string getThisProcessLoggingColor();
109 static bool color_enabled;
119 #endif //WRENCH_S4U_COLORLOGGING_H