Joedb 9.1.4
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Destructor_Logger.cpp
Go to the documentation of this file.
3
4#include <iostream>
5
6namespace joedb
7{
8 static Stream_Logger default_logger(std::cerr);
9 Logger *Destructor_Logger::the_logger = &default_logger;
10
11 ////////////////////////////////////////////////////////////////////////////
12 void Destructor_Logger::write(const char * message) noexcept
13 ////////////////////////////////////////////////////////////////////////////
14 {
15 if (the_logger)
16 the_logger->write(message);
17 }
18
19 ////////////////////////////////////////////////////////////////////////////
21 ////////////////////////////////////////////////////////////////////////////
22 {
23 the_logger = new_logger;
24 }
25
26 ////////////////////////////////////////////////////////////////////////////
28 ////////////////////////////////////////////////////////////////////////////
29 {
30 the_logger = &default_logger;
31 }
32
33 ////////////////////////////////////////////////////////////////////////////
35 ////////////////////////////////////////////////////////////////////////////
36 {
37 the_logger = nullptr;
38 }
39}
static void write(const char *message) noexcept
Definition Blob.h:7