21 Config& instance = GetInstance();
23 CppCommon::Locker<CppCommon::CriticalSection> locker(instance._lock);
25 instance._config[
""] = sink;
30 Config& instance = GetInstance();
32 CppCommon::Locker<CppCommon::CriticalSection> locker(instance._lock);
34 instance._config[name] = sink;
39 Config& instance = GetInstance();
41 CppCommon::Locker<CppCommon::CriticalSection> locker(instance._lock);
43 auto it = instance._working.find(
"");
44 if (it != instance._working.end())
45 return Logger(it->first, it->second);
48 auto sink = std::make_shared<Processor>(std::make_shared<TextLayout>());
49 sink->appenders().push_back(std::make_shared<ConsoleAppender>());
50 instance._working[
""] = sink;
57 Config& instance = GetInstance();
59 CppCommon::Locker<CppCommon::CriticalSection> locker(instance._lock);
61 auto it = instance._working.find(name);
62 if (it != instance._working.end())
63 return Logger(it->first, it->second);
70 Config& instance = GetInstance();
72 CppCommon::Locker<CppCommon::CriticalSection> locker(instance._lock);
75 std::swap(instance._working, instance._config);
78 for (
auto& processor : instance._working)
80 processor.second->Start();
83 instance._config.clear();
88 Config& instance = GetInstance();
90 CppCommon::Locker<CppCommon::CriticalSection> locker(instance._lock);
93 for (
auto& processor : instance._working)
97 processor.second->Flush();
98 processor.second->Stop();
103 instance._working.clear();
Logger configuration static class.
static void Shutdown()
Shutdown the logging infrastructure.
static void ConfigLogger(const std::shared_ptr< Processor > &sink)
Configure default logger with a given logging sink processor.
static void Startup()
Startup the logging infrastructure.
static Logger CreateLogger()
Create default logger.
Logger configuration definition.
C++ Logging project definitions.
void swap(Record &record1, Record &record2) noexcept