Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
Loading...
Searching...
No Matches
null_logger_backend.h
Go to the documentation of this file.
1// BSD 3-Clause License
2// Copyright (c) 2025, 🍀☀🌕🌥 🌊
3// See the LICENSE file in the project root for full license information.
4
16#pragma once
17
18#include "logger_backend.h"
19
20namespace database
21{
22namespace integrated
23{
24namespace adapters
25{
26namespace backends
27{
28
37{
38public:
43 explicit null_logger_backend(const db_logger_config& /*config*/)
44 {
45 }
46
47 ~null_logger_backend() override = default;
48
50 {
51 return common::ok();
52 }
53
55 {
56 return common::ok();
57 }
58
59 bool is_initialized() const override
60 {
61 return true; // Always "initialized" (no-op)
62 }
63
64 void log(db_log_level /*level*/, const std::string& /*message*/) override
65 {
66 // No-op: discard log message
67 }
68
69 void flush() override
70 {
71 // No-op: nothing to flush
72 }
73};
74
75} // namespace backends
76} // namespace adapters
77} // namespace integrated
78} // namespace database
Abstract base class for logger backends.
null_logger_backend(const db_logger_config &)
Construct null logger backend.
common::VoidResult shutdown() override
Shutdown the logger backend gracefully.
common::VoidResult initialize() override
Initialize the logger backend.
bool is_initialized() const override
Check if backend is initialized.
void log(db_log_level, const std::string &) override
Log a message.
Abstract interface for logger backends.
VoidResult ok()
db_log_level
Database logging level enumeration.