Update src/Loggers/Loggers.cpp

Co-authored-by: Nikolay Degterinsky <43110995+evillique@users.noreply.github.com>
This commit is contained in:
Mallik Hassan 2022-07-26 03:44:16 -03:00 committed by GitHub
parent 943affe2da
commit 968e867a0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,21 +204,17 @@ void Loggers::buildLoggers(Poco::Util::AbstractConfiguration & config, Poco::Log
{
max_log_level = console_log_level;
}
Poco::AutoPtr<OwnPatternFormatter> pf = new OwnPatternFormatter;
if (config.has("logger.json"))
{
Poco::AutoPtr<OwnJSONPatternFormatter> pf = new OwnJSONPatternFormatter();
Poco::AutoPtr<DB::OwnFormattingChannel> log = new DB::OwnFormattingChannel(pf, new Poco::ConsoleChannel);
log->setLevel(console_log_level);
split->addChannel(log, "console");
}
pf = new OwnJSONPatternFormatter;
else
{
Poco::AutoPtr<OwnPatternFormatter> pf = new OwnPatternFormatter(color_enabled);
pf = new OwnPatternFormatter(true);
Poco::AutoPtr<DB::OwnFormattingChannel> log = new DB::OwnFormattingChannel(pf, new Poco::ConsoleChannel);
log->setLevel(console_log_level);
split->addChannel(log, "console");
}
}
split->open();