Agora  1.2.0
Agora project
spdlog::sinks::mongo_sink< Mutex > Class Template Reference

#include <mongo_sink.h>

Inheritance diagram for spdlog::sinks::mongo_sink< Mutex >:
Collaboration diagram for spdlog::sinks::mongo_sink< Mutex >:

Public Member Functions

 mongo_sink (const std::string &db_name, const std::string &collection_name, const std::string &uri="mongodb://localhost:27017")
 
 ~mongo_sink ()
 
- Public Member Functions inherited from spdlog::sinks::base_sink< Mutex >
 base_sink ()
 
 base_sink (std::unique_ptr< spdlog::formatter > formatter)
 
 ~base_sink () override=default
 
 base_sink (const base_sink &)=delete
 
 base_sink (base_sink &&)=delete
 
base_sinkoperator= (const base_sink &)=delete
 
base_sinkoperator= (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
virtual ~sink ()=default
 
void set_level (level::level_enum log_level)
 
level::level_enum level () const
 
bool should_log (level::level_enum msg_level) const
 

Protected Member Functions

void sink_it_ (const details::log_msg &msg) override
 
void flush_ () override
 
- Protected Member Functions inherited from spdlog::sinks::base_sink< Mutex >
virtual void set_pattern_ (const std::string &pattern)
 
virtual void set_formatter_ (std::unique_ptr< spdlog::formatter > sink_formatter)
 

Private Member Functions

mongocxx::instance instance_
 

Private Attributes

std::string db_name_
 
std::string coll_name_
 
std::unique_ptr< mongocxx::client > client_ = nullptr
 

Static Private Attributes

static mongocxx::instance instance_
 

Additional Inherited Members

- Protected Attributes inherited from spdlog::sinks::base_sink< Mutex >
std::unique_ptr< spdlog::formatterformatter_
 
Mutex mutex_
 
- Protected Attributes inherited from spdlog::sinks::sink
level_t level_ {level::trace}
 

Constructor & Destructor Documentation

◆ mongo_sink()

template<typename Mutex >
spdlog::sinks::mongo_sink< Mutex >::mongo_sink ( const std::string &  db_name,
const std::string &  collection_name,
const std::string &  uri = "mongodb://localhost:27017" 
)
inline

◆ ~mongo_sink()

template<typename Mutex >
spdlog::sinks::mongo_sink< Mutex >::~mongo_sink ( )
inline
Here is the call graph for this function:

Member Function Documentation

◆ flush_()

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

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

Here is the caller graph for this function:

◆ instance_()

mongocxx::instance spdlog::sinks::mongo_sink< std::mutex >::instance_
private

◆ sink_it_()

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

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

Here is the call graph for this function:

Member Data Documentation

◆ client_

template<typename Mutex >
std::unique_ptr<mongocxx::client> spdlog::sinks::mongo_sink< Mutex >::client_ = nullptr
private

◆ coll_name_

template<typename Mutex >
std::string spdlog::sinks::mongo_sink< Mutex >::coll_name_
private

◆ db_name_

template<typename Mutex >
std::string spdlog::sinks::mongo_sink< Mutex >::db_name_
private

◆ instance_

template<typename Mutex >
mongocxx::instance spdlog::sinks::mongo_sink< Mutex >::instance_
staticprivate

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