Flyby SDK v0.3.0
Loading...
Searching...
No Matches
flyby::Logger Class Reference

The base logger class. More...

#include <log.h>

Public Member Functions

 Logger (const std::string &filepath)
 Constructs a logger that writes to a file.
 
void set_log_level (LogLevel level)
 Sets the current log level.
 
virtual void log (LogLevel level, const std::string &message)
 Logs a message at a log level.
 
virtual void log (LogLevel level, const std::string &tag, const std::string &message)
 Logs a message at a log level.
 
virtual void d (const std::string &message)
 Logs a message at the debug log level.
 
virtual void d (const std::string &tag, const std::string &message)
 Logs a message at the debug log level.
 
virtual void i (const std::string &message)
 Logs a message at the info log level.
 
virtual void i (const std::string &tag, const std::string &message)
 Logs a message at the info log level.
 
virtual void w (const std::string &message)
 Logs a message at the warning log level.
 
virtual void w (const std::string &tag, const std::string &message)
 Logs a message at the warning log level.
 
virtual void e (const std::string &message)
 Logs a message at the error log level.
 
virtual void e (const std::string &tag, const std::string &message)
 Logs a message at the error log level.
 

Protected Member Functions

 Logger ()=default
 Constructs an empty logger.
 

Detailed Description

The base logger class.

Constructor & Destructor Documentation

◆ Logger() [1/2]

flyby::Logger::Logger ( const std::string & filepath)
explicit

Constructs a logger that writes to a file.

Parameters
filepath- The path where the log should be stored

◆ Logger() [2/2]

flyby::Logger::Logger ( )
protecteddefault

Constructs an empty logger.

Used for mocking and testing

Member Function Documentation

◆ d() [1/2]

virtual void flyby::Logger::d ( const std::string & message)
virtual

Logs a message at the debug log level.

Parameters
message- The message to log

◆ d() [2/2]

virtual void flyby::Logger::d ( const std::string & tag,
const std::string & message )
virtual

Logs a message at the debug log level.

Parameters
tag- The tag of the log
message- The message to log

◆ e() [1/2]

virtual void flyby::Logger::e ( const std::string & message)
virtual

Logs a message at the error log level.

Parameters
message- The message to log

◆ e() [2/2]

virtual void flyby::Logger::e ( const std::string & tag,
const std::string & message )
virtual

Logs a message at the error log level.

Parameters
tag- The tag of the log
message- The message to log

◆ i() [1/2]

virtual void flyby::Logger::i ( const std::string & message)
virtual

Logs a message at the info log level.

Parameters
message- The message to log

◆ i() [2/2]

virtual void flyby::Logger::i ( const std::string & tag,
const std::string & message )
virtual

Logs a message at the info log level.

Parameters
tag- The tag of the log
message- The message to log

◆ log() [1/2]

virtual void flyby::Logger::log ( LogLevel level,
const std::string & message )
virtual

Logs a message at a log level.

Parameters
level- The log level
message- The message to log

◆ log() [2/2]

virtual void flyby::Logger::log ( LogLevel level,
const std::string & tag,
const std::string & message )
virtual

Logs a message at a log level.

Parameters
level- The log level
tag- The tag of the log
message- The message to log

◆ set_log_level()

void flyby::Logger::set_log_level ( LogLevel level)

Sets the current log level.

Parameters
level- The log level

◆ w() [1/2]

virtual void flyby::Logger::w ( const std::string & message)
virtual

Logs a message at the warning log level.

Parameters
message- The message to log

◆ w() [2/2]

virtual void flyby::Logger::w ( const std::string & tag,
const std::string & message )
virtual

Logs a message at the warning log level.

Parameters
tag- The tag of the log
message- The message to log

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