|
Thunderbots Project
|
#include <coloured_cout_sink.h>
Public Member Functions | |
| ColouredCoutSink (bool print_detailed, bool reduce_repetition=true) | |
| void | displayColouredLog (g3::LogMessageMover log_entry) |
| void | displaySingleLog (g3::LogMessage &log) |
Static Public Member Functions | |
| static std::string | colourToString (const FG_Colour colour) |
This class acts a custom sink for g3log
| ColouredCoutSink | ( | bool | print_detailed, |
| bool | reduce_repetition = true |
||
| ) |
creates a ColouredCoutSink which prints logs in different colours based on their level
| print_detailed | If true, prints the log message as well as other details (level, file line, etc). If false, only prints the message |
|
static |
This is a helper function for mapping the FG_Colour enum to its relative Linux xterm foreground color http://stackoverflow.com/questions/2616906/how-do-i-output-coloured-text-to-a-linux-terminal
| colour | the colour to be converted |
| void displayColouredLog | ( | g3::LogMessageMover | log_entry | ) |
This function is called on every call to LOG(). Displays coloured log messages in the terminal. Merges repeated messages to display later
@params log_entry the message received on a LOG() call
| void displaySingleLog | ( | g3::LogMessage & | log | ) |
Displays a single coloured log message in the terminal, without merging.
@params log the LogMessage to output