Go to the source code of this file.
Definition at line 76 of file StandardLogHandlerTest.cpp.
References ASSERT_EQ, config, folly::DBG8, EXPECT_EQ, folly::StandardLogHandler::handleMessage(), handler(), string, and folly::LoggerDB::TESTING.
77 auto writer = make_shared<TestLogWriter>();
83 auto handlerCategory = db.getCategory(
"handler_cat");
91 handler.handleMessage(msg, handlerCategory);
92 ASSERT_EQ(1, writer->getMessages().size());
94 "DBG8::log_cat::handler_cat::src/test.cpp::1234::hello world",
95 writer->getMessages()[0]);
#define ASSERT_EQ(val1, val2)
LogCategory * getCategory(folly::StringPiece name)
#define EXPECT_EQ(val1, val2)
void handler(int, siginfo_t *, void *)
Definition at line 98 of file StandardLogHandlerTest.cpp.
References ASSERT_EQ, config, folly::DBG1, folly::DBG2, folly::DBG3, folly::DBG9, folly::ERR, EXPECT_EQ, folly::StandardLogHandler::handleMessage(), handler(), folly::INFO, message, messages, folly::StandardLogHandler::setLevel(), folly::LoggerDB::TESTING, and folly::WARN.
99 auto writer = make_shared<TestLogWriter>();
105 auto handlerCategory = db.getCategory(
"handler_cat");
109 logCategory, level,
"src/test.cpp", 1234,
"testMethod",
message};
110 handler.handleMessage(msg, handlerCategory);
113 handler.setLevel(LogLevel::WARN);
114 logMsg(LogLevel::INFO,
"info");
115 logMsg(LogLevel::WARN,
"beware");
116 logMsg(LogLevel::ERR,
"whoops");
117 logMsg(LogLevel::DBG1,
"debug stuff");
119 auto&
messages = writer->getMessages();
122 "WARN::log_cat::handler_cat::src/test.cpp::1234::beware",
messages.at(0));
124 "ERR::log_cat::handler_cat::src/test.cpp::1234::whoops",
messages.at(1));
127 handler.setLevel(LogLevel::DBG2);
128 logMsg(LogLevel::DBG3,
"dbg");
129 logMsg(LogLevel::DBG1,
"here");
130 logMsg(LogLevel::DBG2,
"and here");
131 logMsg(LogLevel::ERR,
"oh noes");
132 logMsg(LogLevel::DBG9,
"very verbose");
136 "DBG1::log_cat::handler_cat::src/test.cpp::1234::here",
messages.at(0));
138 "DBG2::log_cat::handler_cat::src/test.cpp::1234::and here",
141 "ERR::log_cat::handler_cat::src/test.cpp::1234::oh noes",
messages.at(2));
static struct message messages[5]
#define ASSERT_EQ(val1, val2)
LogCategory * getCategory(folly::StringPiece name)
#define EXPECT_EQ(val1, val2)
void handler(int, siginfo_t *, void *)