WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
spdlog::logger Class Reference

#include <logger.h>

Inheritance diagram for spdlog::logger:

Public Member Functions

 logger (std::string name, sink_ptr single_sink)
 
 logger (std::string name, sinks_init_list sinks)
 
template<typename It >
 logger (std::string name, It begin, It end)
 
virtual ~logger ()
 
 logger (const logger &)=delete
 
loggeroperator= (const logger &)=delete
 
template<typename... Args>
void log (level::level_enum lvl, const char *fmt, const Args &... args)
 
template<typename... Args>
void log (source_loc loc, level::level_enum lvl, const char *fmt, const Args &... args)
 
void log (level::level_enum lvl, const char *msg)
 
void log (source_loc loc, level::level_enum lvl, const char *msg)
 
template<typename... Args>
void trace (const char *fmt, const Args &... args)
 
template<typename... Args>
void debug (const char *fmt, const Args &... args)
 
template<typename... Args>
void info (const char *fmt, const Args &... args)
 
template<typename... Args>
void warn (const char *fmt, const Args &... args)
 
template<typename... Args>
void error (const char *fmt, const Args &... args)
 
template<typename... Args>
void critical (const char *fmt, const Args &... args)
 
template<class T , typename std::enable_if< std::is_convertible< T, spdlog::string_view_t >::value, T >::type * = nullptr>
void log (level::level_enum lvl, const T &)
 
template<class T , typename std::enable_if< std::is_convertible< T, spdlog::string_view_t >::value, T >::type * = nullptr>
void log (source_loc loc, level::level_enum lvl, const T &)
 
template<class T , typename std::enable_if<!std::is_convertible< T, spdlog::string_view_t >::value, T >::type * = nullptr>
void log (level::level_enum lvl, const T &)
 
template<class T , typename std::enable_if<!std::is_convertible< T, spdlog::string_view_t >::value, T >::type * = nullptr>
void log (source_loc loc, level::level_enum lvl, const T &)
 
template<typename T >
void trace (const T &msg)
 
template<typename T >
void debug (const T &msg)
 
template<typename T >
void info (const T &msg)
 
template<typename T >
void warn (const T &msg)
 
template<typename T >
void error (const T &msg)
 
template<typename T >
void critical (const T &msg)
 
bool should_log (level::level_enum msg_level) const
 
void set_level (level::level_enum log_level)
 
level::level_enum level () const
 
const std::string & name () const
 
void set_formatter (std::unique_ptr< formatter > formatter)
 
void set_pattern (std::string pattern, pattern_time_type time_type=pattern_time_type::local)
 
void flush ()
 
void flush_on (level::level_enum log_level)
 
level::level_enum flush_level () const
 
const std::vector< sink_ptr > & sinks () const
 
std::vector< sink_ptr > & sinks ()
 
void set_error_handler (log_err_handler err_handler)
 
log_err_handler error_handler () const
 
virtual std::shared_ptr< loggerclone (std::string logger_name)
 

Static Public Member Functions

static level::level_enum default_level ()
 

Protected Member Functions

virtual void sink_it_ (details::log_msg &msg)
 
virtual void flush_ ()
 
bool should_flush_ (const details::log_msg &msg)
 
void default_err_handler_ (const std::string &msg)
 
void incr_msg_counter_ (details::log_msg &msg)
 

Protected Attributes

const std::string name_
 
std::vector< sink_ptrsinks_
 
spdlog::level_t level_ {spdlog::logger::default_level()}
 
spdlog::level_t flush_level_ {level::off}
 
log_err_handler err_handler_ {[this](const std::string &msg) { this->default_err_handler_(msg); }}
 
std::atomic< time_t > last_err_time_ {0}
 
std::atomic< size_t > msg_counter_ {1}
 

Detailed Description

Definition at line 31 of file logger.h.

Constructor & Destructor Documentation

◆ logger() [1/4]

spdlog::logger::logger ( std::string  name,
spdlog::sink_ptr  single_sink 
)
inline

Definition at line 39 of file logger_impl.h.

Here is the call graph for this function:

◆ logger() [2/4]

spdlog::logger::logger ( std::string  name,
sinks_init_list  sinks 
)
inline

Definition at line 33 of file logger_impl.h.

◆ logger() [3/4]

template<typename It >
spdlog::logger::logger ( std::string  name,
It  begin,
It  end 
)
inline

Definition at line 26 of file logger_impl.h.

◆ ~logger()

spdlog::logger::~logger ( )
inlinevirtualdefault
Here is the caller graph for this function:

◆ logger() [4/4]

spdlog::logger::logger ( const logger )
delete

Member Function Documentation

◆ clone()

std::shared_ptr< spdlog::logger > spdlog::logger::clone ( std::string  logger_name)
inlinevirtual

Reimplemented in spdlog::async_logger.

Definition at line 434 of file logger_impl.h.

Here is the call graph for this function:

◆ critical() [1/2]

template<typename... Args>
void spdlog::logger::critical ( const char *  fmt,
const Args &...  args 
)
inline

Definition at line 181 of file logger_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ critical() [2/2]

template<typename T>
void spdlog::logger::critical ( const T &  msg)
inline

Definition at line 217 of file logger_impl.h.

Here is the call graph for this function:

◆ debug() [1/2]

template<typename... Args>
void spdlog::logger::debug ( const char *  fmt,
const Args &...  args 
)
inline

Definition at line 157 of file logger_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ debug() [2/2]

template<typename T>
void spdlog::logger::debug ( const T &  msg)
inline

Definition at line 193 of file logger_impl.h.

Here is the call graph for this function:

◆ default_err_handler_()

void spdlog::logger::default_err_handler_ ( const std::string &  msg)
inlineprotected

Definition at line 405 of file logger_impl.h.

Here is the call graph for this function:

◆ default_level()

spdlog::level::level_enum spdlog::logger::default_level ( )
inlinestatic

Definition at line 359 of file logger_impl.h.

Here is the caller graph for this function:

◆ error() [1/2]

template<typename... Args>
void spdlog::logger::error ( const char *  fmt,
const Args &...  args 
)
inline

Definition at line 175 of file logger_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ error() [2/2]

template<typename T>
void spdlog::logger::error ( const T &  msg)
inline

Definition at line 211 of file logger_impl.h.

Here is the call graph for this function:

◆ error_handler()

spdlog::log_err_handler spdlog::logger::error_handler ( ) const
inline

Definition at line 329 of file logger_impl.h.

Here is the caller graph for this function:

◆ flush()

void spdlog::logger::flush ( )
inline

Definition at line 334 of file logger_impl.h.

Here is the call graph for this function:

◆ flush_()

void spdlog::logger::flush_ ( )
inlineprotectedvirtual

Reimplemented in spdlog::async_logger.

Definition at line 397 of file logger_impl.h.

Here is the caller graph for this function:

◆ flush_level()

spdlog::level::level_enum spdlog::logger::flush_level ( ) const
inline

Definition at line 348 of file logger_impl.h.

Here is the caller graph for this function:

◆ flush_on()

void spdlog::logger::flush_on ( level::level_enum  log_level)
inline

Definition at line 343 of file logger_impl.h.

◆ incr_msg_counter_()

void spdlog::logger::incr_msg_counter_ ( details::log_msg msg)
inlineprotected

Definition at line 419 of file logger_impl.h.

Here is the caller graph for this function:

◆ info() [1/2]

template<typename... Args>
void spdlog::logger::info ( const char *  fmt,
const Args &...  args 
)
inline

Definition at line 163 of file logger_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ info() [2/2]

template<typename T>
void spdlog::logger::info ( const T &  msg)
inline

Definition at line 199 of file logger_impl.h.

Here is the call graph for this function:

◆ level()

spdlog::level::level_enum spdlog::logger::level ( ) const
inline

Definition at line 364 of file logger_impl.h.

Here is the caller graph for this function:

◆ log() [1/8]

template<typename... Args>
void spdlog::logger::log ( level::level_enum  lvl,
const char *  fmt,
const Args &...  args 
)
inline

Definition at line 80 of file logger_impl.h.

Here is the caller graph for this function:

◆ log() [2/8]

template<typename... Args>
void spdlog::logger::log ( source_loc  loc,
level::level_enum  lvl,
const char *  fmt,
const Args &...  args 
)
inline

Definition at line 61 of file logger_impl.h.

Here is the call graph for this function:

◆ log() [3/8]

void spdlog::logger::log ( level::level_enum  lvl,
const char *  msg 
)
inline

Definition at line 100 of file logger_impl.h.

Here is the call graph for this function:

◆ log() [4/8]

void spdlog::logger::log ( source_loc  loc,
level::level_enum  lvl,
const char *  msg 
)
inline

Definition at line 85 of file logger_impl.h.

Here is the call graph for this function:

◆ log() [5/8]

template<class T, typename std::enable_if<!std::is_convertible< T, spdlog::string_view_t >::value, T >::type * >
void spdlog::logger::log ( level::level_enum  lvl,
const T &  msg 
)
inline

Definition at line 121 of file logger_impl.h.

Here is the call graph for this function:

◆ log() [6/8]

template<class T, typename std::enable_if<!std::is_convertible< T, spdlog::string_view_t >::value, T >::type * >
void spdlog::logger::log ( source_loc  loc,
level::level_enum  lvl,
const T &  msg 
)
inline

Definition at line 106 of file logger_impl.h.

Here is the call graph for this function:

◆ log() [7/8]

template<class T , typename std::enable_if<!std::is_convertible< T, spdlog::string_view_t >::value, T >::type * = nullptr>
void spdlog::logger::log ( level::level_enum  lvl,
const T &   
)

◆ log() [8/8]

template<class T , typename std::enable_if<!std::is_convertible< T, spdlog::string_view_t >::value, T >::type * = nullptr>
void spdlog::logger::log ( source_loc  loc,
level::level_enum  lvl,
const T &   
)

◆ name()

const std::string & spdlog::logger::name ( ) const
inline

Definition at line 314 of file logger_impl.h.

Here is the caller graph for this function:

◆ operator=()

logger& spdlog::logger::operator= ( const logger )
delete

◆ set_error_handler()

void spdlog::logger::set_error_handler ( spdlog::log_err_handler  err_handler)
inline

Definition at line 324 of file logger_impl.h.

◆ set_formatter()

void spdlog::logger::set_formatter ( std::unique_ptr< formatter formatter)
inline

Definition at line 46 of file logger_impl.h.

Here is the caller graph for this function:

◆ set_level()

void spdlog::logger::set_level ( level::level_enum  log_level)
inline

Definition at line 319 of file logger_impl.h.

◆ set_pattern()

void spdlog::logger::set_pattern ( std::string  pattern,
pattern_time_type  time_type = pattern_time_type::local 
)
inline

Definition at line 54 of file logger_impl.h.

Here is the call graph for this function:

◆ should_flush_()

bool spdlog::logger::should_flush_ ( const details::log_msg msg)
inlineprotected

Definition at line 353 of file logger_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ should_log()

bool spdlog::logger::should_log ( level::level_enum  msg_level) const
inline

Definition at line 369 of file logger_impl.h.

Here is the caller graph for this function:

◆ sink_it_()

void spdlog::logger::sink_it_ ( details::log_msg msg)
inlineprotectedvirtual

Reimplemented in spdlog::async_logger.

Definition at line 378 of file logger_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sinks() [1/2]

const std::vector< spdlog::sink_ptr > & spdlog::logger::sinks ( ) const
inline

Definition at line 424 of file logger_impl.h.

◆ sinks() [2/2]

std::vector< spdlog::sink_ptr > & spdlog::logger::sinks ( )
inline

Definition at line 429 of file logger_impl.h.

◆ trace() [1/2]

template<typename... Args>
void spdlog::logger::trace ( const char *  fmt,
const Args &...  args 
)
inline

Definition at line 151 of file logger_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trace() [2/2]

template<typename T>
void spdlog::logger::trace ( const T &  msg)
inline

Definition at line 187 of file logger_impl.h.

Here is the call graph for this function:

◆ warn() [1/2]

template<typename... Args>
void spdlog::logger::warn ( const char *  fmt,
const Args &...  args 
)
inline

Definition at line 169 of file logger_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ warn() [2/2]

template<typename T>
void spdlog::logger::warn ( const T &  msg)
inline

Definition at line 205 of file logger_impl.h.

Here is the call graph for this function:

Member Data Documentation

◆ err_handler_

log_err_handler spdlog::logger::err_handler_ {[this](const std::string &msg) { this->default_err_handler_(msg); }}
protected

Definition at line 182 of file logger.h.

◆ flush_level_

spdlog::level_t spdlog::logger::flush_level_ {level::off}
protected

Definition at line 181 of file logger.h.

◆ last_err_time_

std::atomic<time_t> spdlog::logger::last_err_time_ {0}
protected

Definition at line 183 of file logger.h.

◆ level_

spdlog::level_t spdlog::logger::level_ {spdlog::logger::default_level()}
protected

Definition at line 180 of file logger.h.

◆ msg_counter_

std::atomic<size_t> spdlog::logger::msg_counter_ {1}
protected

Definition at line 184 of file logger.h.

◆ name_

const std::string spdlog::logger::name_
protected

Definition at line 178 of file logger.h.

◆ sinks_

std::vector<sink_ptr> spdlog::logger::sinks_
protected

Definition at line 179 of file logger.h.


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