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

#include <log_merger.h>

Public Member Functions

 LogMerger (bool enable_merging=true)
 
std::list< g3::LogMessage > log (g3::LogMessage &log)
 
void pastime ()
 
g3::LogMessage _addRepeats (g3::LogMessage &log, int repeats)
 
std::list< g3::LogMessage > _getOldMessages (std::chrono::_V2::system_clock::time_point current_time)
 

Public Attributes

const std::chrono::_V2::system_clock::duration LOG_MERGE_DURATION
 

Detailed Description

Handles merging repeated log messages into a single message

Constructor & Destructor Documentation

◆ LogMerger()

LogMerger ( bool  enable_merging = true)
explicit

Creates a merger to hold repeated log messages

Parameters
enable_mergingWhether to merge logs or not

Member Function Documentation

◆ _addRepeats()

g3::LogMessage _addRepeats ( g3::LogMessage &  log,
int  repeats 
)

Add number of repeats to a log

◆ _getOldMessages()

std::list< g3::LogMessage > _getOldMessages ( std::chrono::_V2::system_clock::time_point  current_time)

Looks through the message list for expired messages, removes them from the list and map, and returns them as strings

◆ log()

std::list< g3::LogMessage > log ( g3::LogMessage &  log)

Returns a list of all logs that should be logged at the current time, starting with the given log (if it isn't a repeat)

Parameters
msgThe LogMessage to be logged

◆ pastime()

void pastime ( )

Adds LOG_MERGE_DURATION amount of time to the merger's currently tracked time. Used for testing

Member Data Documentation

◆ LOG_MERGE_DURATION

const std::chrono::_V2::system_clock::duration LOG_MERGE_DURATION
Initial value:
=
std::chrono::seconds(2)

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