Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
Loading...
Searching...
No Matches
database::integrated::adapters::backends::null_logger_backend Class Reference

No-op logger backend. More...

#include <null_logger_backend.h>

Inheritance diagram for database::integrated::adapters::backends::null_logger_backend:
Inheritance graph
Collaboration diagram for database::integrated::adapters::backends::null_logger_backend:
Collaboration graph

Public Member Functions

 null_logger_backend (const db_logger_config &)
 Construct null logger backend.
 
 ~null_logger_backend () override=default
 
common::VoidResult initialize () override
 Initialize the logger backend.
 
common::VoidResult shutdown () override
 Shutdown the logger backend gracefully.
 
bool is_initialized () const override
 Check if backend is initialized.
 
void log (db_log_level, const std::string &) override
 Log a message.
 
void flush () override
 Flush pending log messages.
 
- Public Member Functions inherited from database::integrated::adapters::backends::logger_backend
virtual ~logger_backend ()=default
 

Detailed Description

No-op logger backend.

This backend discards all log messages. All methods are no-ops. Useful for disabling logging without changing client code.

Definition at line 36 of file null_logger_backend.h.

Constructor & Destructor Documentation

◆ null_logger_backend()

database::integrated::adapters::backends::null_logger_backend::null_logger_backend ( const db_logger_config & )
inlineexplicit

Construct null logger backend.

Parameters
configLogger configuration (ignored)

Definition at line 43 of file null_logger_backend.h.

44 {
45 }

◆ ~null_logger_backend()

database::integrated::adapters::backends::null_logger_backend::~null_logger_backend ( )
overridedefault

Member Function Documentation

◆ flush()

void database::integrated::adapters::backends::null_logger_backend::flush ( )
inlineoverridevirtual

Flush pending log messages.

Implements database::integrated::adapters::backends::logger_backend.

Definition at line 69 of file null_logger_backend.h.

70 {
71 // No-op: nothing to flush
72 }

◆ initialize()

common::VoidResult database::integrated::adapters::backends::null_logger_backend::initialize ( )
inlineoverridevirtual

Initialize the logger backend.

Returns
VoidResult::ok() on success, error on failure

Implements database::integrated::adapters::backends::logger_backend.

Definition at line 49 of file null_logger_backend.h.

50 {
51 return common::ok();
52 }
VoidResult ok()

References common::ok().

Here is the call graph for this function:

◆ is_initialized()

bool database::integrated::adapters::backends::null_logger_backend::is_initialized ( ) const
inlineoverridevirtual

Check if backend is initialized.

Returns
true if initialized and ready to log

Implements database::integrated::adapters::backends::logger_backend.

Definition at line 59 of file null_logger_backend.h.

60 {
61 return true; // Always "initialized" (no-op)
62 }

◆ log()

void database::integrated::adapters::backends::null_logger_backend::log ( db_log_level level,
const std::string & message )
inlineoverridevirtual

Log a message.

Parameters
levelLog level
messageMessage to log

Implements database::integrated::adapters::backends::logger_backend.

Definition at line 64 of file null_logger_backend.h.

65 {
66 // No-op: discard log message
67 }

◆ shutdown()

common::VoidResult database::integrated::adapters::backends::null_logger_backend::shutdown ( )
inlineoverridevirtual

Shutdown the logger backend gracefully.

Returns
VoidResult::ok() on success, error on failure

Implements database::integrated::adapters::backends::logger_backend.

Definition at line 54 of file null_logger_backend.h.

55 {
56 return common::ok();
57 }

References common::ok().

Here is the call graph for this function:

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