ClickHouse/src/Common/tests/gtest_log.cpp

20 lines
547 B
C++
Raw Normal View History

2020-05-29 00:09:12 +00:00
#include <string>
#include <vector>
#include <common/logger_useful.h>
#include <gtest/gtest.h>
#include <Poco/Logger.h>
#include <Poco/AutoPtr.h>
#include <Poco/NullChannel.h>
TEST(Logger, Log)
{
Poco::Logger::root().setLevel("none");
Poco::Logger::root().setChannel(Poco::AutoPtr<Poco::NullChannel>(new Poco::NullChannel()));
2020-05-30 21:57:37 +00:00
Poco::Logger * log = &Poco::Logger::get("Log");
2020-05-29 00:09:12 +00:00
/// This test checks that we don't pass this string to fmtlib, because it is the only argument.
EXPECT_NO_THROW(LOG_INFO(log, "Hello {} World"));
}