ClickHouse/libs/libloggers/loggers/OwnFormattingChannel.cpp
proller 09f3d68f6e Use logging in clickhouse-local. Use config options in command line in clickhouse-client (#5540)
* Try fix macos server run

* Doc macos build
 # Please enter the commit message for your changes. Lines starting

* CLICKHOUSE-3957 start wip

* tests wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix

* fix

* Making logger for clickhouse-local

* fixes

* wip

* wip

* wip

* wip

* clean

*      cf

* wip

* fix

* Update CMakeLists.txt

* Update argsToConfig.h

* Update argsToConfig.cpp

* Update ExtendedLogChannel.h

* Update OwnPatternFormatter.cpp
2019-06-14 17:00:37 +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;
}