Helios++
Helios software for LiDAR simulations
file_logger Class Reference

Class representing a logger capable of writing to files. More...

#include <file_logger.hpp>

Inheritance diagram for file_logger:
Collaboration diagram for file_logger:

Public Member Functions

 file_logger (const logging_config_t &config)
 File logger constructor. More...
 
virtual void log (const std::string &message, const log_level level)
 
void log (const std::string &message) override
 
- Public Member Functions inherited from logger
 logger (const logging_config_t &config)
 Logger constructor. More...
 

Protected Member Functions

void reopen ()
 Reopen the log file in a thread-safe fashion.
 

Protected Attributes

std::string file_name
 Name of output file.
 
std::ofstream file
 Output file stream.
 
std::chrono::seconds reopen_interval
 Reopen interval in seconds.
 
std::chrono::system_clock::time_point last_reopen
 Time point when last reopen took place.
 
- Protected Attributes inherited from logger
std::mutex lock
 Mutex to handle concurrent log writes.
 

Detailed Description

Class representing a logger capable of writing to files.

Constructor & Destructor Documentation

◆ file_logger()

file_logger::file_logger ( const logging_config_t &  config)
inline

File logger constructor.

Parameters
configFile logger configuration, which can be used to specify reopen file name and reopen interval

Member Function Documentation

◆ log() [1/2]

void file_logger::log ( const std::string &  message)
inlineoverridevirtual
See also
logger::log(const std::string&)

Reimplemented from logger.

Reimplemented in full_logger.

◆ log() [2/2]

virtual void file_logger::log ( const std::string &  message,
const log_level  level 
)
inlinevirtual

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