ClickHouse/base/loggers/OwnFormattingChannel.cpp
Alexey Milovidov 669a15b943 Whitespaces
2020-05-31 16:48:43 +03:00

33 lines
656 B
C++

#include "OwnFormattingChannel.h"
#include "OwnPatternFormatter.h"
namespace DB
{
void OwnFormattingChannel::logExtended(const ExtendedLogMessage & msg)
{
if (pChannel && priority >= msg.base.getPriority())
{
if (pFormatter)
{
std::string text;
pFormatter->formatExtended(msg, text);
pChannel->log(Poco::Message(msg.base, text));
}
else
{
pChannel->log(msg.base);
}
}
}
void OwnFormattingChannel::log(const Poco::Message & msg)
{
logExtended(ExtendedLogMessage::getFrom(msg));
}
OwnFormattingChannel::~OwnFormattingChannel() = default;
}