ClickHouse/programs/library-bridge/ExternalDictionaryLibraryAPI.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.3 KiB
C++
Raw Normal View History

#include "ExternalDictionaryLibraryAPI.h"
2022-04-27 15:05:45 +00:00
#include <Common/logger_useful.h>
namespace
{
2018-06-06 14:35:33 +00:00
const char DICT_LOGGER_NAME[] = "LibraryDictionarySourceExternal";
}
void ExternalDictionaryLibraryAPI::log(LogLevel level, CString msg)
2021-03-13 11:09:56 +00:00
{
2024-01-23 17:04:50 +00:00
auto logger = getLogger(DICT_LOGGER_NAME);
switch (level)
{
case LogLevel::TRACE:
2024-01-23 17:04:50 +00:00
if (logger->trace())
logger->trace(msg);
break;
case LogLevel::DEBUG:
2024-01-23 17:04:50 +00:00
if (logger->debug())
logger->debug(msg);
break;
case LogLevel::INFORMATION:
2024-01-23 17:04:50 +00:00
if (logger->information())
logger->information(msg);
break;
case LogLevel::NOTICE:
2024-01-23 17:04:50 +00:00
if (logger->notice())
logger->notice(msg);
break;
case LogLevel::WARNING:
2024-01-23 17:04:50 +00:00
if (logger->warning())
logger->warning(msg);
break;
case LogLevel::ERROR:
2024-01-23 17:04:50 +00:00
if (logger->error())
logger->error(msg);
break;
case LogLevel::CRITICAL:
2024-01-23 17:04:50 +00:00
if (logger->critical())
logger->critical(msg);
break;
case LogLevel::FATAL:
2024-01-23 17:04:50 +00:00
if (logger->fatal())
logger->fatal(msg);
break;
}
}