Thunderbots Project
Loading...
Searching...
No Matches
ColouredCoutSink Class Reference

#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)
 

Detailed Description

This class acts a custom sink for g3log

Constructor & Destructor Documentation

◆ ColouredCoutSink()

ColouredCoutSink ( bool  print_detailed,
bool  reduce_repetition = true 
)

creates a ColouredCoutSink which prints logs in different colours based on their level

Parameters
print_detailedIf true, prints the log message as well as other details (level, file line, etc). If false, only prints the message

Member Function Documentation

◆ colourToString()

std::string colourToString ( const FG_Colour  colour)
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

Parameters
colourthe colour to be converted
Returns
the string representation of the FG_Colour

◆ displayColouredLog()

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

◆ displaySingleLog()

void displaySingleLog ( g3::LogMessage &  log)

Displays a single coloured log message in the terminal, without merging.

@params log the LogMessage to output


The documentation for this class was generated from the following files: