63 getType(), &writerFactory, options);
89 using namespace folly;
95 writer = std::make_shared<TestLogWriter>();
96 db.registerHandlerFactory(
97 std::make_unique<TestHandlerFactory>(writer),
true);
99 parseLogConfig(
"test=INFO:default; default=test:sync_level=WARN"));
103 Logger logger{&db,
"test"};
104 std::shared_ptr<TestLogWriter> writer;
113 EXPECT_EQ(writer->unflushed_messages_count, 0);
114 EXPECT_EQ(writer->flushed_messages_count, 0);
123 EXPECT_EQ(writer->unflushed_messages_count, 4);
124 EXPECT_EQ(writer->flushed_messages_count, 0);
128 EXPECT_EQ(writer->unflushed_messages_count, 0);
129 EXPECT_EQ(writer->flushed_messages_count, 5);
134 EXPECT_EQ(writer->unflushed_messages_count, 1);
135 EXPECT_EQ(writer->flushed_messages_count, 5);
140 EXPECT_EQ(writer->unflushed_messages_count, 0);
141 EXPECT_EQ(writer->flushed_messages_count, 8);
146 EXPECT_EQ(writer->unflushed_messages_count, 0);
147 EXPECT_EQ(writer->flushed_messages_count, 10);
std::shared_ptr< TestLogWriter > writer_
static std::shared_ptr< StandardLogHandler > createHandler(StringPiece type, WriterFactory *writerFactory, const Options &options)
TestHandlerFactory(const std::shared_ptr< TestLogWriter > writer)
#define EXPECT_EQ(val1, val2)
bool ttyOutput() const override
—— Concurrent Priority Queue Implementation ——
int unflushed_messages_count
#define FB_LOG(logger, level,...)
LogConfig parseLogConfig(StringPiece value)
int flushed_messages_count
StringPiece getType() const override
std::shared_ptr< LogHandler > createHandler(const Options &options) override
std::shared_ptr< LogWriter > createWriter() override
TEST_F(AsyncSSLSocketWriteTest, write_coalescing1)
std::shared_ptr< TestLogWriter > writer_
bool processOption(StringPiece, StringPiece) override
std::unordered_map< std::string, std::string > Options
TestWriterFactory(std::shared_ptr< TestLogWriter > writer)
void writeMessage(folly::StringPiece, uint32_t=0) override