2019-06-14 14:00:37 +00:00
|
|
|
#include "OwnFormattingChannel.h"
|
|
|
|
#include "OwnPatternFormatter.h"
|
2018-06-15 17:32:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-05-31 13:48:43 +00:00
|
|
|
|
2018-06-15 17:32:35 +00:00
|
|
|
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;
|
|
|
|
|
|
|
|
}
|