ClickHouse/base/loggers/OwnFormattingChannel.cpp
Ivan b7ef5a699c
Move FastMemcpy to contribs (#9219)
* Get rid of non-existent vectorclass
* Move FastMemcpy to contribs
* Restore comments
* Disable FastMemcpy on non-Linux
* Fix cmake file
* Don't build FastMemcpy for ARM64
* Replace FastMemcpy submodule with its contents
* Fix cmake file
* Move widechar_width to contrib/
* Move sumbur to contrib/
* Move consistent-hashing to contrib/
* Fix UBSan tests
2020-03-13 01:26:16 +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;
}