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