mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
mrs_lib::ScopeTimerLogger Class Reference

Simple file logger of scope timer and its checkpoints. More...

#include <scope_timer.h>

Public Types

using chrono_tp = std::chrono::time_point< std::chrono::steady_clock >
 

Public Member Functions

 ScopeTimerLogger (const std::string &logfile, const bool enable_logging=true, const int log_precision=10)
 The basic constructor with a user-defined path to the logger file, enable flag and float-logging precision.
 
 ~ScopeTimerLogger ()
 The basic destructor which closes the logging file.
 
bool shouldLog ()
 Returns true if a non-empty path to a logger file was given by the user.
 
bool loggingEnabled ()
 Returns true if the enable flag was set to true, a non-empty path to a logger file was given by the user and the logger file stream was successfully opened.
 
std::string getLogFilepath ()
 Returns the path to the log.
 
void log (const std::string &scope, const chrono_tp &time_start, const chrono_tp &time_end)
 Writes the time data of the given scope and empty checkpoints into the logger stream.
 
void log (const std::string &scope, const std::string &label_from, const std::string &label_to, const chrono_tp &time_start, const chrono_tp &time_end)
 Writes the time data of the given scope and checkpoint labels into the logger stream.
 

Detailed Description

Simple file logger of scope timer and its checkpoints.


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