Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
Loading...
Searching...
No Matches
logger_adapter.h File Reference

Database logging adapter with runtime backend selection. More...

#include "../core/configuration.h"
#include <chrono>
#include <cstddef>
#include <memory>
#include <string>
#include "../core/common_result.h"
Include dependency graph for logger_adapter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  database::integrated::adapters::logger_adapter
 Unified logging adapter for database operations. More...
 

Namespaces

namespace  database
 
namespace  database::integrated
 
namespace  database::integrated::adapters
 
namespace  database::integrated::adapters::backends
 

Enumerations

enum class  database::integrated::adapters::logger_backend_type { database::integrated::adapters::auto_select , database::integrated::adapters::system , database::integrated::adapters::fallback , database::integrated::adapters::null }
 Logger backend type selection. More...
 

Detailed Description

Database logging adapter with runtime backend selection.

This adapter provides unified logging interface for database operations using the backend pattern for runtime polymorphism.

Available backends:

  • common_logger_backend: Uses common_system's ILogger and GlobalLoggerRegistry (default)
  • fallback_logger_backend: Uses std::cout + std::ofstream (when common_system unavailable)
  • null_logger_backend: No-op backend for disabling logging

Features:

  • SQL query logging with sanitization (password removal, truncation)
  • Automatic slow query detection and warning
  • Connection pool event logging
  • Transaction logging
  • Error logging with SQL state codes
  • Thread-safe operation
  • Runtime backend selection (no conditional compilation)

Definition in file logger_adapter.h.