2022-08-03 11:19:13 +00:00
|
|
|
#include "ExternalDictionaryLibraryAPI.h"
|
2021-04-13 19:53:36 +00:00
|
|
|
|
2022-04-27 15:05:45 +00:00
|
|
|
#include <Common/logger_useful.h>
|
2018-06-05 19:17:16 +00:00
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
2018-06-06 14:35:33 +00:00
|
|
|
const char DICT_LOGGER_NAME[] = "LibraryDictionarySourceExternal";
|
|
|
|
}
|
2018-06-05 19:17:16 +00:00
|
|
|
|
2022-08-03 11:19:13 +00:00
|
|
|
void ExternalDictionaryLibraryAPI::log(LogLevel level, CString msg)
|
2021-03-13 11:09:56 +00:00
|
|
|
{
|
2020-05-30 21:57:37 +00:00
|
|
|
auto & logger = Poco::Logger::get(DICT_LOGGER_NAME);
|
2018-06-06 20:21:16 +00:00
|
|
|
switch (level)
|
|
|
|
{
|
|
|
|
case LogLevel::TRACE:
|
|
|
|
if (logger.trace())
|
|
|
|
logger.trace(msg);
|
|
|
|
break;
|
|
|
|
case LogLevel::DEBUG:
|
|
|
|
if (logger.debug())
|
|
|
|
logger.debug(msg);
|
|
|
|
break;
|
|
|
|
case LogLevel::INFORMATION:
|
|
|
|
if (logger.information())
|
|
|
|
logger.information(msg);
|
|
|
|
break;
|
|
|
|
case LogLevel::NOTICE:
|
|
|
|
if (logger.notice())
|
|
|
|
logger.notice(msg);
|
|
|
|
break;
|
|
|
|
case LogLevel::WARNING:
|
|
|
|
if (logger.warning())
|
|
|
|
logger.warning(msg);
|
|
|
|
break;
|
|
|
|
case LogLevel::ERROR:
|
|
|
|
if (logger.error())
|
|
|
|
logger.error(msg);
|
|
|
|
break;
|
|
|
|
case LogLevel::CRITICAL:
|
|
|
|
if (logger.critical())
|
|
|
|
logger.critical(msg);
|
|
|
|
break;
|
|
|
|
case LogLevel::FATAL:
|
|
|
|
if (logger.fatal())
|
|
|
|
logger.fatal(msg);
|
|
|
|
break;
|
2018-06-05 19:17:16 +00:00
|
|
|
}
|
|
|
|
}
|