Helios++
Helios software for LiDAR simulations
logging.hpp File Reference
#include <string>
#include <stdexcept>
#include <iostream>
#include <fstream>
#include <sstream>
#include <mutex>
#include <unordered_map>
#include <memory>
#include <chrono>
#include <ctime>
#include <cstdlib>
#include <logging_common.hpp>
#include <logger.hpp>
#include <std_out_logger.hpp>
#include <file_logger.hpp>
#include <full_logger.hpp>
#include <logger_factory.hpp>
#include <logging_creation.hpp>
Include dependency graph for logging.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::string logging::timestamp ()
 Obtain current timestamp with format: "yy/mm/dd HH:MM:SS.xxxxxx". More...
 
logger_factorylogging::get_factory ()
 Obtain a logger factory singleton instance. More...
 
loggerlogging::get_logger (const logging_config_t &config={ {"type", "std_out"}, {"color", ""} })
 Obtain a singleton logger through singleton factory. More...
 
void logging::configure (const logging_config_t &config)
 Apply given configuration to current logger. More...
 
void logging::log (const std::string &message, const log_level level)
 Log function wrapper for singleton logger. More...
 
void logging::log (const std::string &message)
 Log function wrapper for singleton logger. More...
 
void logging::makeQuiet ()
 Configure logging mode to make it quiet. Quiet mode means only errors will be shown.
 
void logging::makeSilent ()
 Configure logging mode to make it silent. Silent mode means nothing will be shown.
 
void logging::makeDefault ()
 Configure logging mode to make it default. Default mode means only info and error messages will be shown.
 
void logging::makeVerbose ()
 Configure logging mode to make it verbose. Verbose mode means only info, warning and error messages will be shown.
 
void logging::makeVerbose2 ()
 Configure logging mode to make it verbose level 2. Verbose level 2 mode means all messages will be shown.
 
void logging::TRACE (const std::string &message)
 Default trace messages logging function. More...
 
void logging::DEBUG (const std::string &message)
 Default debug messages logging function. More...
 
void logging::INFO (const std::string &message)
 Default info messages logging function. More...
 
void logging::WARN (const std::string &message)
 Default warning messages logging function. More...
 
void logging::ERR (const std::string &message)
 Default error messages logging function. More...
 

Variables

bool logging::LOGGING_SHOW_TRACE
 
bool logging::LOGGING_SHOW_DEBUG
 
bool logging::LOGGING_SHOW_INFO
 
bool logging::LOGGING_SHOW_WARN
 
bool logging::LOGGING_SHOW_ERR
 

Detailed Description

Logging source hub

Function Documentation

◆ configure()

void logging::configure ( const logging_config_t &  config)
inline

Apply given configuration to current logger.

Parameters
configConfiguration to be applied to singleton logger

◆ DEBUG()

void logging::DEBUG ( const std::string &  message)
inline

Default debug messages logging function.

Parameters
messageLog message

◆ ERR()

void logging::ERR ( const std::string &  message)
inline

Default error messages logging function.

Parameters
messageLog message

◆ get_factory()

logger_factory& logging::get_factory ( )
inline

Obtain a logger factory singleton instance.

Returns
Logger factory singleton instance

◆ get_logger()

logger& logging::get_logger ( const logging_config_t &  config = { {"type", "std_out"}, {"color", ""} })
inline

Obtain a singleton logger through singleton factory.

Parameters
configConfig for the logger
Returns
Singleton logger

◆ INFO()

void logging::INFO ( const std::string &  message)
inline

Default info messages logging function.

Parameters
messageLog message

◆ log() [1/2]

void logging::log ( const std::string &  message,
const log_level  level 
)
inline

Log function wrapper for singleton logger.

See also
logger::log(const std::string&, const log_level)

◆ log() [2/2]

void logging::log ( const std::string &  message)
inline

Log function wrapper for singleton logger.

See also
logger::log(const std::string&)

◆ timestamp()

std::string logging::timestamp ( )
inline

Obtain current timestamp with format: "yy/mm/dd HH:MM:SS.xxxxxx".

Returns
String timestamp with format: "yy/mm/dd HH:MM:SS.xxxxxx"

◆ TRACE()

void logging::TRACE ( const std::string &  message)
inline

Default trace messages logging function.

Parameters
messageLog message

◆ WARN()

void logging::WARN ( const std::string &  message)
inline

Default warning messages logging function.

Parameters
messageLog message