Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
spdlog::sinks::base_sink< Mutex > Class Template Referenceabstract

#include <base_sink.h>

Inheritance diagram for spdlog::sinks::base_sink< Mutex >:
spdlog::sinks::sink spdlog::sinks::android_sink< Mutex > spdlog::sinks::basic_file_sink< Mutex > spdlog::sinks::daily_file_sink< Mutex, FileNameCalc > spdlog::sinks::dist_sink< Mutex > spdlog::sinks::null_sink< Mutex > spdlog::sinks::ostream_sink< Mutex > spdlog::sinks::rotating_file_sink< Mutex > spdlog::sinks::syslog_sink< Mutex >

Public Member Functions

 base_sink ()=default
 
 base_sink (const base_sink &)=delete
 
base_sinkoperator= (const base_sink &)=delete
 
void log (const details::log_msg &msg) final
 
void flush () final
 
void set_pattern (const std::string &pattern) final
 
void set_formatter (std::unique_ptr< spdlog::formatter > sink_formatter) final
 
- Public Member Functions inherited from spdlog::sinks::sink
 sink ()
 
 sink (std::unique_ptr< spdlog::pattern_formatter > formatter)
 
virtual ~sink ()=default
 
bool should_log (level::level_enum msg_level) const
 
void set_level (level::level_enum log_level)
 
level::level_enum level () const
 

Protected Member Functions

virtual void sink_it_ (const details::log_msg &msg)=0
 
virtual void flush_ ()=0
 
virtual void set_pattern_ (const std::string &pattern)
 
virtual void set_formatter_ (std::unique_ptr< spdlog::formatter > sink_formatter)
 

Protected Attributes

Mutex mutex_
 
- Protected Attributes inherited from spdlog::sinks::sink
level_t level_
 
std::unique_ptr< spdlog::formatterformatter_
 

Detailed Description

template<typename Mutex>
class spdlog::sinks::base_sink< Mutex >

Definition at line 22 of file base_sink.h.

Constructor & Destructor Documentation

template<typename Mutex >
spdlog::sinks::base_sink< Mutex >::base_sink ( )
default
template<typename Mutex >
spdlog::sinks::base_sink< Mutex >::base_sink ( const base_sink< Mutex > &  )
delete

Member Function Documentation

template<typename Mutex >
void spdlog::sinks::base_sink< Mutex >::flush ( )
inlinefinalvirtual

Implements spdlog::sinks::sink.

Definition at line 35 of file base_sink.h.

36  {
37  std::lock_guard<Mutex> lock(mutex_);
38  flush_();
39  }
virtual void flush_()=0
template<typename Mutex >
virtual void spdlog::sinks::base_sink< Mutex >::flush_ ( )
protectedpure virtual
template<typename Mutex >
void spdlog::sinks::base_sink< Mutex >::log ( const details::log_msg msg)
inlinefinalvirtual

Implements spdlog::sinks::sink.

Definition at line 29 of file base_sink.h.

30  {
31  std::lock_guard<Mutex> lock(mutex_);
32  sink_it_(msg);
33  }
void msg(const char *fmt,...)
Definition: message.cpp:107
virtual void sink_it_(const details::log_msg &msg)=0
template<typename Mutex >
base_sink& spdlog::sinks::base_sink< Mutex >::operator= ( const base_sink< Mutex > &  )
delete
template<typename Mutex >
void spdlog::sinks::base_sink< Mutex >::set_formatter ( std::unique_ptr< spdlog::formatter sink_formatter)
inlinefinalvirtual

Implements spdlog::sinks::sink.

Definition at line 47 of file base_sink.h.

48  {
49  std::lock_guard<Mutex> lock(mutex_);
50  set_formatter_(std::move(sink_formatter));
51  }
virtual void set_formatter_(std::unique_ptr< spdlog::formatter > sink_formatter)
Definition: base_sink.h:62
def move(depos, offset)
Definition: depos.py:107
template<typename Mutex >
virtual void spdlog::sinks::base_sink< Mutex >::set_formatter_ ( std::unique_ptr< spdlog::formatter sink_formatter)
inlineprotectedvirtual

Reimplemented in spdlog::sinks::dist_sink< Mutex >.

Definition at line 62 of file base_sink.h.

63  {
64  formatter_ = std::move(sink_formatter);
65  }
std::unique_ptr< spdlog::formatter > formatter_
Definition: sink.h:55
def move(depos, offset)
Definition: depos.py:107
template<typename Mutex >
void spdlog::sinks::base_sink< Mutex >::set_pattern ( const std::string pattern)
inlinefinalvirtual

Implements spdlog::sinks::sink.

Definition at line 41 of file base_sink.h.

42  {
43  std::lock_guard<Mutex> lock(mutex_);
45  }
std::string pattern
Definition: regex_t.cc:33
virtual void set_pattern_(const std::string &pattern)
Definition: base_sink.h:57
template<typename Mutex >
virtual void spdlog::sinks::base_sink< Mutex >::set_pattern_ ( const std::string pattern)
inlineprotectedvirtual

Reimplemented in spdlog::sinks::dist_sink< Mutex >.

Definition at line 57 of file base_sink.h.

58  {
59  set_formatter_(details::make_unique<spdlog::pattern_formatter>(pattern));
60  }
virtual void set_formatter_(std::unique_ptr< spdlog::formatter > sink_formatter)
Definition: base_sink.h:62
std::string pattern
Definition: regex_t.cc:33
template<typename Mutex >
virtual void spdlog::sinks::base_sink< Mutex >::sink_it_ ( const details::log_msg msg)
protectedpure virtual

Member Data Documentation

template<typename Mutex >
Mutex spdlog::sinks::base_sink< Mutex >::mutex_
protected

Definition at line 66 of file base_sink.h.


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