1#include "LibraryDictionarySourceExternal.h"
2#include <common/logger_useful.h>
3
4namespace
5{
6const char DICT_LOGGER_NAME[] = "LibraryDictionarySourceExternal";
7}
8
9void ClickHouseLibrary::log(ClickHouseLibrary::LogLevel level, ClickHouseLibrary::CString msg)
10{
11 using ClickHouseLibrary::LogLevel;
12
13 auto & logger = Logger::get(DICT_LOGGER_NAME);
14 switch (level)
15 {
16 case LogLevel::TRACE:
17 if (logger.trace())
18 logger.trace(msg);
19 break;
20 case LogLevel::DEBUG:
21 if (logger.debug())
22 logger.debug(msg);
23 break;
24 case LogLevel::INFORMATION:
25 if (logger.information())
26 logger.information(msg);
27 break;
28 case LogLevel::NOTICE:
29 if (logger.notice())
30 logger.notice(msg);
31 break;
32 case LogLevel::WARNING:
33 if (logger.warning())
34 logger.warning(msg);
35 break;
36 case LogLevel::ERROR:
37 if (logger.error())
38 logger.error(msg);
39 break;
40 case LogLevel::CRITICAL:
41 if (logger.critical())
42 logger.critical(msg);
43 break;
44 case LogLevel::FATAL:
45 if (logger.fatal())
46 logger.fatal(msg);
47 break;
48 }
49}
50