Livox SDK API  V2.2.0
spdlog::logger Class Reference

#include <logger.h>

Inheritance diagram for spdlog::logger:
spdlog::async_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 >
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 (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

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

Definition at line 39 of file logger_impl.h.

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

Definition at line 33 of file logger_impl.h.

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

Definition at line 26 of file logger_impl.h.

spdlog::logger::~logger ( )
inlinevirtualdefault
spdlog::logger::logger ( const logger )
delete

Member Function Documentation

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

Reimplemented in spdlog::async_logger.

Definition at line 428 of file logger_impl.h.

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

Definition at line 175 of file logger_impl.h.

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

Definition at line 211 of file logger_impl.h.

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

Definition at line 151 of file logger_impl.h.

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

Definition at line 187 of file logger_impl.h.

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

Definition at line 399 of file logger_impl.h.

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

Definition at line 353 of file logger_impl.h.

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

Definition at line 169 of file logger_impl.h.

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

Definition at line 205 of file logger_impl.h.

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

Definition at line 323 of file logger_impl.h.

void spdlog::logger::flush ( )
inline

Definition at line 328 of file logger_impl.h.

void spdlog::logger::flush_ ( )
inlineprotectedvirtual

Reimplemented in spdlog::async_logger.

Definition at line 391 of file logger_impl.h.

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

Definition at line 342 of file logger_impl.h.

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

Definition at line 337 of file logger_impl.h.

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

Definition at line 413 of file logger_impl.h.

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

Definition at line 157 of file logger_impl.h.

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

Definition at line 193 of file logger_impl.h.

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

Definition at line 358 of file logger_impl.h.

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.

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.

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

Definition at line 100 of file logger_impl.h.

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

Definition at line 85 of file logger_impl.h.

template<class T>
void spdlog::logger::log ( level::level_enum  lvl,
const T &  msg 
)
inline

Definition at line 106 of file logger_impl.h.

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 112 of file logger_impl.h.

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 &   
)
const std::string & spdlog::logger::name ( ) const
inline

Definition at line 308 of file logger_impl.h.

logger& spdlog::logger::operator= ( const logger )
delete
void spdlog::logger::set_error_handler ( spdlog::log_err_handler  err_handler)
inline

Definition at line 318 of file logger_impl.h.

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

Definition at line 46 of file logger_impl.h.

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

Definition at line 313 of file logger_impl.h.

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.

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

Definition at line 347 of file logger_impl.h.

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

Definition at line 363 of file logger_impl.h.

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

Reimplemented in spdlog::async_logger.

Definition at line 372 of file logger_impl.h.

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

Definition at line 418 of file logger_impl.h.

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

Definition at line 423 of file logger_impl.h.

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

Definition at line 145 of file logger_impl.h.

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

Definition at line 181 of file logger_impl.h.

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

Definition at line 163 of file logger_impl.h.

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

Definition at line 199 of file logger_impl.h.

Member Data Documentation

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

Definition at line 177 of file logger.h.

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

Definition at line 176 of file logger.h.

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

Definition at line 178 of file logger.h.

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

Definition at line 175 of file logger.h.

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

Definition at line 179 of file logger.h.

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

Definition at line 173 of file logger.h.

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

Definition at line 174 of file logger.h.


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