Leosac  0.8.0
Open Source Access Control
Leosac::Tools::DatabaseLogSink Class Reference

A custom sink that write LogEntry object to a SQLite database. More...

#include <DatabaseLogSink.hpp>

+ Inheritance diagram for Leosac::Tools::DatabaseLogSink:
+ Collaboration diagram for Leosac::Tools::DatabaseLogSink:

Public Member Functions

 DatabaseLogSink (DBPtr database)
 Construct a SQLite backed log sink. More...
 
virtual void log (const spdlog::details::log_msg &msg) override
 
virtual void flush () override
 

Private Attributes

DBPtr database_
 
std::string run_id_
 

Detailed Description

A custom sink that write LogEntry object to a SQLite database.

Definition at line 33 of file DatabaseLogSink.hpp.

Constructor & Destructor Documentation

◆ DatabaseLogSink()

DatabaseLogSink::DatabaseLogSink ( DBPtr  database)

Construct a SQLite backed log sink.

Parameters
databaseA non null pointer to a ODB database object.

Definition at line 31 of file DatabaseLogSink.cpp.

Member Function Documentation

◆ flush()

virtual void Leosac::Tools::DatabaseLogSink::flush ( )
inlineoverridevirtual

Definition at line 44 of file DatabaseLogSink.hpp.

◆ log()

void DatabaseLogSink::log ( const spdlog::details::log_msg &  msg)
overridevirtual

Definition at line 40 of file DatabaseLogSink.cpp.

Member Data Documentation

◆ database_

DBPtr Leosac::Tools::DatabaseLogSink::database_
private

Definition at line 50 of file DatabaseLogSink.hpp.

◆ run_id_

std::string Leosac::Tools::DatabaseLogSink::run_id_
private

Definition at line 51 of file DatabaseLogSink.hpp.


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