Joedb
10.3.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
src
joedb
error
CLog_Logger.cpp
Go to the documentation of this file.
1
#include "
joedb/error/CLog_Logger.h
"
2
#include "
joedb/ui/get_time_string.h
"
3
4
#include <iostream>
5
6
namespace
joedb
7
{
8
std::mutex CLog_Logger::mutex;
9
10
////////////////////////////////////////////////////////////////////////////
11
CLog_Logger::CLog_Logger
(std::string tag): tag(std::move(tag))
12
{
13
}
14
15
////////////////////////////////////////////////////////////////////////////
16
void
CLog_Logger::log
(
const
std::string &message)
noexcept
17
{
18
try
19
{
20
std::unique_lock lock(mutex);
21
std::clog <<
joedb::get_time_string_of_now
() <<
' '
;
22
if
(!tag.empty())
23
std::clog << tag <<
": "
;
24
std::clog << message <<
'\n'
;
25
std::clog.flush();
26
}
27
catch
(...)
28
{
29
}
30
}
31
}
CLog_Logger.h
joedb::CLog_Logger::log
void log(const std::string &message) noexcept override
Definition
CLog_Logger.cpp:16
joedb::CLog_Logger::CLog_Logger
CLog_Logger(std::string tag="")
Definition
CLog_Logger.cpp:11
get_time_string.h
joedb::get_time_string_of_now
std::string get_time_string_of_now()
Definition
get_time_string.cpp:26
joedb
Definition
Server.cpp:10
Generated by
1.9.8