0.4.1
Loading...
Searching...
No Matches
Logger Class Reference

Utility class for logging. More...

Public Member Functions

 Logger ()
 Default constructor.
 
 Logger (const Logger &)=delete
 Copy constructor.
 
 Logger (const std::string &logpath)
 Constructor.
 
 Logger (Logger &&)=default
 Move constructor.
 
Loggeroperator= (const Logger &)=delete
 Copy assignment operator.
 
Loggeroperator= (Logger &&)=default
 Move assignment operator.
 
 ~Logger ()
 Destructor.
 

Static Public Member Functions

static const std::shared_ptr< spdlog::sinks::ringbuffer_sink_mt > & GetRingBufferSink ()
 Returns the ring buffer sink.
 

Static Private Member Functions

static void writeFooter () noexcept
 Writes the logging footer.
 
static void writeHeader () noexcept
 Writes the logging header.
 
static void writeSeparator () noexcept
 Writes a separation line to the console only.
 

Static Private Attributes

static std::shared_ptr< spdlog::sinks::ringbuffer_sink_mt > _ringBufferSink
 Ring buffer sink.
 

Detailed Description

Utility class for logging.

Use the Macros to do logging, as they can be turned off during compilation

  • LOG_DATA("Message {} {}", variable1, variable 2);
  • LOG_TRACE("Message {} {}", variable1, variable 2);
  • LOG_DEBUG("Message {} {}", variable1, variable 2);
  • LOG_INFO("Message {} {}", variable1, variable 2);
  • LOG_WARN("Message {} {}", variable1, variable 2);
  • LOG_ERROR("Message {} {}", variable1, variable 2);
  • LOG_CRITICAL("Message {} {}", variable1, variable 2);

Definition at line 87 of file Logger.hpp.

Constructor & Destructor Documentation

◆ Logger() [1/4]

Logger::Logger ( const std::string & logpath)
explicit

Constructor.

Parameters
[in]logpathRelative filepath to the logfile

Definition at line 56 of file Logger.cpp.

◆ Logger() [2/4]

Logger::Logger ( )

Default constructor.

Definition at line 149 of file Logger.cpp.

◆ ~Logger()

Logger::~Logger ( )

Destructor.

Definition at line 174 of file Logger.cpp.

◆ Logger() [3/4]

Logger::Logger ( const Logger & )
delete

Copy constructor.

◆ Logger() [4/4]

Logger::Logger ( Logger && )
default

Move constructor.

Member Function Documentation

◆ GetRingBufferSink()

const std::shared_ptr< spdlog::sinks::ringbuffer_sink_mt > & Logger::GetRingBufferSink ( )
static

Returns the ring buffer sink.

Definition at line 181 of file Logger.cpp.

◆ operator=() [1/2]

Logger & Logger::operator= ( const Logger & )
delete

Copy assignment operator.

◆ operator=() [2/2]

Logger & Logger::operator= ( Logger && )
default

Move assignment operator.

◆ writeFooter()

void Logger::writeFooter ( )
staticprivatenoexcept

Writes the logging footer.

Definition at line 206 of file Logger.cpp.

◆ writeHeader()

void Logger::writeHeader ( )
staticprivatenoexcept

Writes the logging header.

Definition at line 191 of file Logger.cpp.

◆ writeSeparator()

void Logger::writeSeparator ( )
staticprivatenoexcept

Writes a separation line to the console only.

Definition at line 186 of file Logger.cpp.

Field Documentation

◆ _ringBufferSink

std::shared_ptr<spdlog::sinks::ringbuffer_sink_mt> Logger::_ringBufferSink
inlinestaticprivate

Ring buffer sink.

Definition at line 112 of file Logger.hpp.


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