TerminalOutput.h
1 
10 #ifndef WRENCH_S4U_COLORLOGGING_H
11 #define WRENCH_S4U_COLORLOGGING_H
12 
13 #include <map>
14 
15 #include <simgrid/s4u/Actor.hpp>
16 
17 #include <iostream>
18 
19 namespace wrench {
20 
21 
22 /* Wrappers around XBT_* macros */
23 
24 #define WRENCH_INFO(...) wrench::TerminalOutput::beginThisProcessColor(); XBT_INFO(__VA_ARGS__) ; wrench::TerminalOutput::endThisProcessColor()
25 
26 #define WRENCH_DEBUG(...) wrench::TerminalOutput::beginThisProcessColor(); XBT_DEBUG(__VA_ARGS__) ; wrench::TerminalOutput::endThisProcessColor()
27 
28 #define WRENCH_WARN(...) wrench::TerminalOutput::beginThisProcessColor(); XBT_WARN(__VA_ARGS__) ; wrench::TerminalOutput::endThisProcessColor()
29 
30  /***********************/
32  /***********************/
33 
38 
39  public:
40 
42  enum Color {
59  };
60 
61  static void setThisProcessLoggingColor(Color color);
62 
63 
64 
65  /***********************/
67  /***********************/
68 
69  static void beginThisProcessColor();
70 
71  static void endThisProcessColor();
72 
73  static void disableColor();
74 
75  /***********************/
77  /***********************/
78 
79  private:
80 
81  static const char * color_codes[];
82 
83  static std::map<simgrid::s4u::Actor *, std::string> colormap;
84 
85  static std::string getThisProcessLoggingColor();
86 
87  static bool color_enabled;
88 
89  };
90 
91  /***********************/
93  /***********************/
94 };
95 
96 
97 #endif //WRENCH_S4U_COLORLOGGING_H
Green text.
Definition: TerminalOutput.h:48
static void setThisProcessLoggingColor(Color color)
Set the color of log messages printed to the terminal.
Definition: TerminalOutput.cpp:36
Red text.
Definition: TerminalOutput.h:46
Blue text.
Definition: TerminalOutput.h:52
White text.
Definition: TerminalOutput.h:58
Color
Terminal output color enum.
Definition: TerminalOutput.h:42
Black text.
Definition: TerminalOutput.h:44
Yellow text.
Definition: TerminalOutput.h:50
Color-enabling wrappers around Simgrid&#39;s XBT_INFO, XBT_DEBUG, XBT_WARN logging macros.
Definition: TerminalOutput.h:37
Cyan text.
Definition: TerminalOutput.h:56
Magenta text.
Definition: TerminalOutput.h:54
Definition: TerminalOutput.cpp:15