Agora  1.2.0
Agora project
spdlog::logger Class Reference

#include <logger.h>

Inheritance diagram for spdlog::logger:
Collaboration diagram for spdlog::logger:

Public Member Functions

 logger (std::string name)
 
template<typename It >
 logger (std::string name, It begin, It end)
 
 logger (std::string name, sink_ptr single_sink)
 
 logger (std::string name, sinks_init_list sinks)
 
virtual ~logger ()=default
 
 logger (const logger &other)
 
 logger (logger &&other) SPDLOG_NOEXCEPT
 
loggeroperator= (logger other) SPDLOG_NOEXCEPT
 
void swap (spdlog::logger &other) SPDLOG_NOEXCEPT
 
template<typename... Args>
void log (source_loc loc, level::level_enum lvl, format_string_t< Args... > fmt, Args &&... args)
 
template<typename... Args>
void log (level::level_enum lvl, format_string_t< Args... > fmt, Args &&... args)
 
template<typename T >
void log (level::level_enum lvl, const T &msg)
 
template<class T , typename std::enable_if<!is_convertible_to_any_format_string< const T & >::value, int >::type = 0>
void log (source_loc loc, level::level_enum lvl, const T &msg)
 
void log (log_clock::time_point log_time, source_loc loc, level::level_enum lvl, string_view_t msg)
 
void log (source_loc loc, level::level_enum lvl, string_view_t msg)
 
void log (level::level_enum lvl, string_view_t msg)
 
template<typename... Args>
void trace (format_string_t< Args... > fmt, Args &&... args)
 
template<typename... Args>
void debug (format_string_t< Args... > fmt, Args &&... args)
 
template<typename... Args>
void info (format_string_t< Args... > fmt, Args &&... args)
 
template<typename... Args>
void warn (format_string_t< Args... > fmt, Args &&... args)
 
template<typename... Args>
void error (format_string_t< Args... > fmt, Args &&... args)
 
template<typename... Args>
void critical (format_string_t< Args... > fmt, Args &&... args)
 
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
 
bool should_backtrace () 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 > f)
 
void set_pattern (std::string pattern, pattern_time_type time_type=pattern_time_type::local)
 
void enable_backtrace (size_t n_messages)
 
void disable_backtrace ()
 
void dump_backtrace ()
 
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 (err_handler)
 
virtual std::shared_ptr< loggerclone (std::string logger_name)
 

Protected Member Functions

template<typename... Args>
void log_ (source_loc loc, level::level_enum lvl, string_view_t fmt, Args &&... args)
 
void log_it_ (const details::log_msg &log_msg, bool log_enabled, bool traceback_enabled)
 
virtual void sink_it_ (const details::log_msg &msg)
 
virtual void flush_ ()
 
void dump_backtrace_ ()
 
bool should_flush_ (const details::log_msg &msg)
 
void err_handler_ (const std::string &msg)
 

Protected Attributes

std::string name_
 
std::vector< sink_ptrsinks_
 
spdlog::level_t level_ {level::info}
 
spdlog::level_t flush_level_ {level::off}
 
err_handler custom_err_handler_ {nullptr}
 
details::backtracer tracer_
 

Constructor & Destructor Documentation

◆ logger() [1/6]

spdlog::logger::logger ( std::string  name)
inlineexplicit

◆ logger() [2/6]

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

◆ logger() [3/6]

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

◆ logger() [4/6]

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

◆ ~logger()

virtual spdlog::logger::~logger ( )
virtualdefault

◆ logger() [5/6]

SPDLOG_INLINE spdlog::logger::logger ( const logger other)

◆ logger() [6/6]

SPDLOG_INLINE spdlog::logger::logger ( logger &&  other)

Member Function Documentation

◆ clone()

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

Reimplemented in spdlog::async_logger.

◆ critical() [1/2]

template<typename T >
void spdlog::logger::critical ( const T msg)
inline
Here is the call graph for this function:

◆ critical() [2/2]

template<typename... Args>
void spdlog::logger::critical ( format_string_t< Args... >  fmt,
Args &&...  args 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ debug() [1/2]

template<typename T >
void spdlog::logger::debug ( const T msg)
inline
Here is the call graph for this function:

◆ debug() [2/2]

template<typename... Args>
void spdlog::logger::debug ( format_string_t< Args... >  fmt,
Args &&...  args 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ disable_backtrace()

SPDLOG_INLINE void spdlog::logger::disable_backtrace ( )
Here is the call graph for this function:

◆ dump_backtrace()

SPDLOG_INLINE void spdlog::logger::dump_backtrace ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump_backtrace_()

SPDLOG_INLINE void spdlog::logger::dump_backtrace_ ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable_backtrace()

SPDLOG_INLINE void spdlog::logger::enable_backtrace ( size_t  n_messages)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ err_handler_()

SPDLOG_INLINE void spdlog::logger::err_handler_ ( const std::string &  msg)
protected
Here is the call graph for this function:

◆ error() [1/2]

template<typename T >
void spdlog::logger::error ( const T msg)
inline
Here is the call graph for this function:

◆ error() [2/2]

template<typename... Args>
void spdlog::logger::error ( format_string_t< Args... >  fmt,
Args &&...  args 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ flush()

SPDLOG_INLINE void spdlog::logger::flush ( )
Here is the call graph for this function:

◆ flush_()

SPDLOG_INLINE void spdlog::logger::flush_ ( )
protectedvirtual

Reimplemented in spdlog::async_logger.

Here is the caller graph for this function:

◆ flush_level()

SPDLOG_INLINE level::level_enum spdlog::logger::flush_level ( ) const
Here is the caller graph for this function:

◆ flush_on()

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

◆ info() [1/2]

template<typename T >
void spdlog::logger::info ( const T msg)
inline
Here is the call graph for this function:

◆ info() [2/2]

template<typename... Args>
void spdlog::logger::info ( format_string_t< Args... >  fmt,
Args &&...  args 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ level()

SPDLOG_INLINE level::level_enum spdlog::logger::level ( ) const
Here is the caller graph for this function:

◆ log() [1/7]

template<typename T >
void spdlog::logger::log ( level::level_enum  lvl,
const T msg 
)
inline
Here is the call graph for this function:

◆ log() [2/7]

template<typename... Args>
void spdlog::logger::log ( level::level_enum  lvl,
format_string_t< Args... >  fmt,
Args &&...  args 
)
inline
Here is the call graph for this function:

◆ log() [3/7]

void spdlog::logger::log ( level::level_enum  lvl,
string_view_t  msg 
)
inline
Here is the call graph for this function:

◆ log() [4/7]

void spdlog::logger::log ( log_clock::time_point  log_time,
source_loc  loc,
level::level_enum  lvl,
string_view_t  msg 
)
inline
Here is the call graph for this function:

◆ log() [5/7]

template<class T , typename std::enable_if<!is_convertible_to_any_format_string< const T & >::value, int >::type = 0>
void spdlog::logger::log ( source_loc  loc,
level::level_enum  lvl,
const T msg 
)
inline
Here is the call graph for this function:

◆ log() [6/7]

template<typename... Args>
void spdlog::logger::log ( source_loc  loc,
level::level_enum  lvl,
format_string_t< Args... >  fmt,
Args &&...  args 
)
inline
Here is the caller graph for this function:

◆ log() [7/7]

void spdlog::logger::log ( source_loc  loc,
level::level_enum  lvl,
string_view_t  msg 
)
inline
Here is the call graph for this function:

◆ log_()

template<typename... Args>
void spdlog::logger::log_ ( source_loc  loc,
level::level_enum  lvl,
string_view_t  fmt,
Args &&...  args 
)
inlineprotected
Here is the call graph for this function:

◆ log_it_()

SPDLOG_INLINE void spdlog::logger::log_it_ ( const details::log_msg log_msg,
bool  log_enabled,
bool  traceback_enabled 
)
protected
Here is the call graph for this function:

◆ name()

const SPDLOG_INLINE std::string & spdlog::logger::name ( ) const
Here is the caller graph for this function:

◆ operator=()

SPDLOG_INLINE logger & spdlog::logger::operator= ( logger  other)
Here is the call graph for this function:

◆ set_error_handler()

SPDLOG_INLINE void spdlog::logger::set_error_handler ( err_handler  handler)

◆ set_formatter()

SPDLOG_INLINE void spdlog::logger::set_formatter ( std::unique_ptr< formatter f)
Here is the caller graph for this function:

◆ set_level()

SPDLOG_INLINE void spdlog::logger::set_level ( level::level_enum  log_level)
Here is the caller graph for this function:

◆ set_pattern()

SPDLOG_INLINE void spdlog::logger::set_pattern ( std::string  pattern,
pattern_time_type  time_type = pattern_time_type::local 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ should_backtrace()

bool spdlog::logger::should_backtrace ( ) const
inline

◆ should_flush_()

SPDLOG_INLINE bool spdlog::logger::should_flush_ ( const details::log_msg msg)
protected
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
Here is the caller graph for this function:

◆ sink_it_()

SPDLOG_INLINE void spdlog::logger::sink_it_ ( const details::log_msg msg)
protectedvirtual

Reimplemented in spdlog::async_logger.

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

◆ sinks() [1/2]

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

◆ sinks() [2/2]

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

◆ swap()

SPDLOG_INLINE void spdlog::logger::swap ( spdlog::logger other)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ trace() [1/2]

template<typename T >
void spdlog::logger::trace ( const T msg)
inline
Here is the call graph for this function:

◆ trace() [2/2]

template<typename... Args>
void spdlog::logger::trace ( format_string_t< Args... >  fmt,
Args &&...  args 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ warn() [1/2]

template<typename T >
void spdlog::logger::warn ( const T msg)
inline
Here is the call graph for this function:

◆ warn() [2/2]

template<typename... Args>
void spdlog::logger::warn ( format_string_t< Args... >  fmt,
Args &&...  args 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ custom_err_handler_

err_handler spdlog::logger::custom_err_handler_ {nullptr}
protected

◆ flush_level_

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

◆ level_

spdlog::level_t spdlog::logger::level_ {level::info}
protected

◆ name_

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

◆ sinks_

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

◆ tracer_

details::backtracer spdlog::logger::tracer_
protected

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