CppLogging 1.0.5.0
C++ Logging Library
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1
9#ifndef CPPLOGGING_CONFIG_H
10#define CPPLOGGING_CONFIG_H
11
12#include "logging/logger.h"
13
14#include <map>
15
16namespace CppLogging {
17
19
24class Config
25{
26public:
27 Config(const Config&) = delete;
28 Config(Config&&) = delete;
29 ~Config();
30
31 Config& operator=(const Config&) = delete;
32 Config& operator=(Config&&) = delete;
33
35
38 static void ConfigLogger(const std::shared_ptr<Processor>& sink);
40
44 static void ConfigLogger(const std::string& name, const std::shared_ptr<Processor>& sink);
45
47
53 static Logger CreateLogger();
55
62 static Logger CreateLogger(const std::string& name);
63
65 static void Startup();
67 static void Shutdown();
68
69private:
70 CppCommon::CriticalSection _lock;
71 std::map<std::string, std::shared_ptr<Processor>> _config;
72 std::map<std::string, std::shared_ptr<Processor>> _working;
73
74 Config() = default;
75
77 static Config& GetInstance()
78 { static Config instance; return instance; }
79};
80
81} // namespace CppLogging
82
83#endif // CPPLOGGING_LOGGER_H
Logger configuration static class.
Definition config.h:25
static void Shutdown()
Shutdown the logging infrastructure.
Definition config.cpp:86
Config(Config &&)=delete
Config(const Config &)=delete
Config & operator=(Config &&)=delete
Config & operator=(const Config &)=delete
static void ConfigLogger(const std::shared_ptr< Processor > &sink)
Configure default logger with a given logging sink processor.
Definition config.cpp:19
static void Startup()
Startup the logging infrastructure.
Definition config.cpp:68
static Logger CreateLogger()
Create default logger.
Definition config.cpp:37
Logger interface.
Definition logger.h:23
Logger interface definition.
C++ Logging project definitions.
Definition appender.h:15