comparison common/logger.h @ 0:a4671277546c tip

created the repository for the thymian project
author ferencd
date Tue, 17 Aug 2021 11:19:54 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:a4671277546c
1 #ifndef LOGGER_H
2 #define LOGGER_H
3
4 #include "log.h"
5 #include "log_machine.h"
6
7 #include <vector>
8 #include <memory>
9 #include <string>
10
11 namespace unafrog
12 {
13 class logger final
14 {
15 public:
16
17 static logger& instance()
18 {
19 static logger the_instance;
20 return the_instance;
21 }
22
23 void propagate_log(unafrog::log::LogLevel level, const std::string& message) noexcept;
24
25 void add_log_machine(unafrog::log::log_machine*);
26
27 private:
28 logger()= default;
29 logger(logger const&) = delete;
30 logger& operator=(logger const&) = delete;
31
32 std::vector<std::shared_ptr<unafrog::log::log_machine>> log_machines;
33 };
34 }
35 #endif // LOGGER_H