1 |
|
|
// |
2 |
|
|
// Created by 4c3y (acey) on 24.11.22. |
3 |
|
|
// |
4 |
|
|
|
5 |
|
|
#ifndef LOG_TEST_LPP_CUSTOM_CALLBACK_H_ |
6 |
|
|
#define LOG_TEST_LPP_CUSTOM_CALLBACK_H_ |
7 |
|
|
|
8 |
|
|
#include <log++.h> |
9 |
|
|
|
10 |
|
|
namespace lpp{ |
11 |
|
|
namespace custom{ |
12 |
|
107 |
inline void logCallback(BaseSeverity severity, const std::string& str) { |
13 |
|
|
|
14 |
|
214 |
std::string severity_str; |
15 |
✓✓✓✓ ✓✗ |
107 |
switch (severity) { |
16 |
|
|
|
17 |
✓✗ |
29 |
case BaseSeverity::DEBUG:severity_str="debug"; break; |
18 |
✓✗ |
20 |
case BaseSeverity::INFO:severity_str="info"; break; |
19 |
✓✗ |
20 |
case BaseSeverity::WARN:severity_str="warning"; break; |
20 |
✓✗ |
20 |
case BaseSeverity::ERROR:severity_str="error"; break; |
21 |
✓✗ |
18 |
case BaseSeverity::FATAL:severity_str="fatal"; break; |
22 |
|
|
} |
23 |
|
|
|
24 |
|
|
|
25 |
✓✗✓✗ ✓✗✓✗ ✓✗ |
107 |
std::cout << "Log++ [" << severity_str << "] " << str << std::endl; |
26 |
|
107 |
} |
27 |
|
|
} |
28 |
|
|
} |
29 |
|
|
|
30 |
|
|
#endif //LOG_TEST_LPP_CUSTOM_CALLBACK_H_ |