spdlog
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
spdlog::sinks::systemd_sink< Mutex > Class Template Reference

Detailed Description

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

Sink that write to systemd journal using the sd_journal_send() library call.

Locking is not needed, as sd_journal_send() itself is thread-safe.

Definition at line 25 of file systemd_sink.h.

#include <systemd_sink.h>

Inheritance diagram for spdlog::sinks::systemd_sink< Mutex >:
[legend]

Public Member Functions

 systemd_sink ()
 
 ~systemd_sink () override
 
 systemd_sink (const systemd_sink &)=delete
 
systemd_sinkoperator= (const systemd_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
 
void set_level (level::level_enum log_level)
 
level::level_enum level () const
 
bool should_log (level::level_enum msg_level) const
 

Protected Types

using levels_array = std::array< int, 7 >
 

Protected Member Functions

void sink_it_ (const details::log_msg &msg) override
 
int syslog_level (level::level_enum l)
 
void flush_ () override
 
virtual void set_pattern_ (const std::string &pattern)
 
virtual void set_formatter_ (std::unique_ptr< spdlog::formatter > sink_formatter)
 

Protected Attributes

levels_array syslog_levels_
 
std::unique_ptr< spdlog::formatterformatter_
 
Mutex mutex_
 
level_t level_ {level::trace}
 

Member Typedef Documentation

◆ levels_array

template<typename Mutex >
using spdlog::sinks::systemd_sink< Mutex >::levels_array = std::array<int, 7>
protected

Definition at line 45 of file systemd_sink.h.

Constructor & Destructor Documentation

◆ systemd_sink() [1/2]

template<typename Mutex >
spdlog::sinks::systemd_sink< Mutex >::systemd_sink ( )
inline

Definition at line 29 of file systemd_sink.h.

◆ ~systemd_sink()

template<typename Mutex >
spdlog::sinks::systemd_sink< Mutex >::~systemd_sink ( )
inlineoverride

Definition at line 39 of file systemd_sink.h.

◆ systemd_sink() [2/2]

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

Member Function Documentation

◆ flush()

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

Implements spdlog::sinks::sink.

Definition at line 33 of file base_sink-inl.h.

◆ flush_()

template<typename Mutex >
void spdlog::sinks::systemd_sink< Mutex >::flush_ ( )
inlineoverrideprotectedvirtual

Implements spdlog::sinks::base_sink< Mutex >.

Definition at line 84 of file systemd_sink.h.

◆ level()

SPDLOG_INLINE spdlog::level::level_enum spdlog::sinks::sink::level ( ) const
inherited

Definition at line 22 of file sink-inl.h.

◆ log()

template<typename Mutex >
void SPDLOG_INLINE spdlog::sinks::base_sink< Mutex >::log ( const details::log_msg msg)
finalvirtualinherited

Implements spdlog::sinks::sink.

Definition at line 26 of file base_sink-inl.h.

◆ operator=()

template<typename Mutex >
systemd_sink & spdlog::sinks::systemd_sink< Mutex >::operator= ( const systemd_sink< Mutex > &  )
delete

◆ set_formatter()

template<typename Mutex >
void SPDLOG_INLINE spdlog::sinks::base_sink< Mutex >::set_formatter ( std::unique_ptr< spdlog::formatter sink_formatter)
finalvirtualinherited

Implements spdlog::sinks::sink.

Definition at line 47 of file base_sink-inl.h.

◆ set_formatter_()

template<typename Mutex >
void SPDLOG_INLINE spdlog::sinks::base_sink< Mutex >::set_formatter_ ( std::unique_ptr< spdlog::formatter sink_formatter)
protectedvirtualinherited

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

Definition at line 60 of file base_sink-inl.h.

◆ set_level()

SPDLOG_INLINE void spdlog::sinks::sink::set_level ( level::level_enum  log_level)
inherited

Definition at line 17 of file sink-inl.h.

◆ set_pattern()

template<typename Mutex >
void SPDLOG_INLINE spdlog::sinks::base_sink< Mutex >::set_pattern ( const std::string pattern)
finalvirtualinherited

Implements spdlog::sinks::sink.

Definition at line 40 of file base_sink-inl.h.

◆ set_pattern_()

template<typename Mutex >
void SPDLOG_INLINE spdlog::sinks::base_sink< Mutex >::set_pattern_ ( const std::string pattern)
protectedvirtualinherited

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

Definition at line 54 of file base_sink-inl.h.

◆ should_log()

SPDLOG_INLINE bool spdlog::sinks::sink::should_log ( level::level_enum  msg_level) const
inherited

Definition at line 12 of file sink-inl.h.

◆ sink_it_()

template<typename Mutex >
void spdlog::sinks::systemd_sink< Mutex >::sink_it_ ( const details::log_msg msg)
inlineoverrideprotectedvirtual

Implements spdlog::sinks::base_sink< Mutex >.

Definition at line 48 of file systemd_sink.h.

◆ syslog_level()

template<typename Mutex >
int spdlog::sinks::systemd_sink< Mutex >::syslog_level ( level::level_enum  l)
inlineprotected

Definition at line 79 of file systemd_sink.h.

Member Data Documentation

◆ formatter_

template<typename Mutex >
std::unique_ptr<spdlog::formatter> spdlog::sinks::base_sink< Mutex >::formatter_
protectedinherited

Definition at line 39 of file base_sink.h.

◆ level_

level_t spdlog::sinks::sink::level_ {level::trace}
protectedinherited

Definition at line 27 of file sink.h.

◆ mutex_

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

Definition at line 40 of file base_sink.h.

◆ syslog_levels_

template<typename Mutex >
levels_array spdlog::sinks::systemd_sink< Mutex >::syslog_levels_
protected

Definition at line 46 of file systemd_sink.h.


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