CPP-TOOLBOX
Loading...
Searching...
No Matches
Logger Class Reference

#include <logger.hpp>

Public Member Functions

 Logger (std::string_view base_name="section_logger")
 
void remove_all_sinks ()
 
void add_sink (std::shared_ptr< spdlog::sinks::sink > sink)
 
void add_file_sink (const std::string &file_path, bool truncate=false)
 
void add_rotating_file_sink (const std::string &file_path, size_t max_size, size_t max_files)
 
void add_stdout_sink (bool color=true)
 
void configure (spdlog::level::level_enum lvl, std::string_view pattern)
 
template<typename... Args>
void log (spdlog::level::level_enum lvl, fmt::format_string< Args... > fmt_str, Args &&...args)
 
void log (spdlog::level::level_enum lvl, std::string_view msg)
 
template<typename... Args>
void trace (fmt::format_string< Args... > fmt_str, Args &&...args)
 
void trace (std::string_view msg)
 
template<typename... Args>
void debug (fmt::format_string< Args... > fmt_str, Args &&...args)
 
void debug (std::string_view msg)
 
template<typename... Args>
void info (fmt::format_string< Args... > fmt_str, Args &&...args)
 
void info (std::string_view msg)
 
template<typename... Args>
void warn (fmt::format_string< Args... > fmt_str, Args &&...args)
 
void warn (std::string_view msg)
 
template<typename... Args>
void error (fmt::format_string< Args... > fmt_str, Args &&...args)
 
void error (std::string_view msg)
 
template<typename... Args>
void critical (fmt::format_string< Args... > fmt_str, Args &&...args)
 
void critical (std::string_view msg)
 
template<typename... Args>
void start_section (fmt::format_string< Args... > fmt_str, Args &&...args)
 
template<typename... Args>
void start_section (spdlog::level::level_enum lvl, fmt::format_string< Args... > fmt_str, Args &&...args)
 
template<typename... Args>
void end_section (fmt::format_string< Args... > fmt_str, Args &&...args)
 
template<typename... Args>
void end_section (spdlog::level::level_enum lvl, fmt::format_string< Args... > fmt_str, Args &&...args)
 
void disable_all_levels ()
 

Constructor & Destructor Documentation

◆ Logger()

Logger::Logger ( std::string_view base_name = "section_logger")
inlineexplicit

Member Function Documentation

◆ add_file_sink()

void Logger::add_file_sink ( const std::string & file_path,
bool truncate = false )
inline

◆ add_rotating_file_sink()

void Logger::add_rotating_file_sink ( const std::string & file_path,
size_t max_size,
size_t max_files )
inline

◆ add_sink()

void Logger::add_sink ( std::shared_ptr< spdlog::sinks::sink > sink)
inline

◆ add_stdout_sink()

void Logger::add_stdout_sink ( bool color = true)
inline

◆ configure()

void Logger::configure ( spdlog::level::level_enum lvl,
std::string_view pattern )
inline

◆ critical() [1/2]

template<typename... Args>
void Logger::critical ( fmt::format_string< Args... > fmt_str,
Args &&... args )
inline

◆ critical() [2/2]

void Logger::critical ( std::string_view msg)
inline

◆ debug() [1/2]

template<typename... Args>
void Logger::debug ( fmt::format_string< Args... > fmt_str,
Args &&... args )
inline

◆ debug() [2/2]

void Logger::debug ( std::string_view msg)
inline

◆ disable_all_levels()

void Logger::disable_all_levels ( )
inline

◆ end_section() [1/2]

template<typename... Args>
void Logger::end_section ( fmt::format_string< Args... > fmt_str,
Args &&... args )
inline

◆ end_section() [2/2]

template<typename... Args>
void Logger::end_section ( spdlog::level::level_enum lvl,
fmt::format_string< Args... > fmt_str,
Args &&... args )
inline

◆ error() [1/2]

template<typename... Args>
void Logger::error ( fmt::format_string< Args... > fmt_str,
Args &&... args )
inline

◆ error() [2/2]

void Logger::error ( std::string_view msg)
inline

◆ info() [1/2]

template<typename... Args>
void Logger::info ( fmt::format_string< Args... > fmt_str,
Args &&... args )
inline

◆ info() [2/2]

void Logger::info ( std::string_view msg)
inline

◆ log() [1/2]

template<typename... Args>
void Logger::log ( spdlog::level::level_enum lvl,
fmt::format_string< Args... > fmt_str,
Args &&... args )
inline

◆ log() [2/2]

void Logger::log ( spdlog::level::level_enum lvl,
std::string_view msg )
inline

◆ remove_all_sinks()

void Logger::remove_all_sinks ( )
inline

◆ start_section() [1/2]

template<typename... Args>
void Logger::start_section ( fmt::format_string< Args... > fmt_str,
Args &&... args )
inline

◆ start_section() [2/2]

template<typename... Args>
void Logger::start_section ( spdlog::level::level_enum lvl,
fmt::format_string< Args... > fmt_str,
Args &&... args )
inline

◆ trace() [1/2]

template<typename... Args>
void Logger::trace ( fmt::format_string< Args... > fmt_str,
Args &&... args )
inline

◆ trace() [2/2]

void Logger::trace ( std::string_view msg)
inline

◆ warn() [1/2]

template<typename... Args>
void Logger::warn ( fmt::format_string< Args... > fmt_str,
Args &&... args )
inline

◆ warn() [2/2]

void Logger::warn ( std::string_view msg)
inline

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