Lines Matching full:log
12 #include "lldb/Utility/Log.h"
22 enum class TestChannel : Log::MaskType {
23 FOO = Log::ChannelFlag<0>,
24 BAR = Log::ChannelFlag<1>,
30 static constexpr Log::Category test_categories[] = {
31 {{"foo"}, {"log foo"}, TestChannel::FOO},
32 {{"bar"}, {"log bar"}, TestChannel::BAR},
35 static Log::Channel test_channel(test_categories, TestChannel::FOO);
38 template <> Log::Channel &LogChannelFor<TestChannel>() { return test_channel; } in LogChannelFor()
48 return Log::EnableLogChannel(log_handler_sp, log_options, channel, categories, in EnableChannel()
57 return Log::DisableLogChannel(channel, categories, error_stream); in DisableChannel()
63 return Log::ListChannelCategories(channel, result_stream); in ListCategories()
69 void TearDown() override { Log::DisableAllLogChannels(); } in TearDown()
71 static void SetUpTestCase() { Log::Register("chan", test_channel); } in SetUpTestCase()
74 Log::Unregister("chan"); in TearDownTestCase()
95 Log *m_log;
100 Log *getLog() { return m_log; } in getLog()
147 Log *log = nullptr; in TEST() local
148 LLDB_LOG(log, "{0}", 0); // Shouldn't crash in TEST()
153 Log::Register("chan", test_channel); in TEST()
154 Log::Unregister("chan"); in TEST()
155 Log::Register("chan", test_channel); in TEST()
156 Log::Unregister("chan"); in TEST()
161 Log::Register("chan", test_channel); in TEST()
166 Log::EnableLogChannel(log_handler_sp, 0, "chan", {"foo"}, llvm::nulls())); in TEST()
168 Log::Unregister("chan"); in TEST()
221 EXPECT_EQ("Invalid log channel 'chanchan'.\n", error); in TEST_F()
233 EXPECT_NE(std::string::npos, error.find("unrecognized log category 'baz'")) in TEST_F()
245 Log *log = GetLog(TestChannel::FOO); in TEST_F() local
246 ASSERT_NE(nullptr, log); in TEST_F()
247 EXPECT_TRUE(log->GetVerbose()); in TEST_F()
264 EXPECT_NE(std::string::npos, error.find("unrecognized log category 'baz'")) in TEST_F()
280 foo - log foo in TEST_F()
281 bar - log bar in TEST_F()
286 EXPECT_EQ("Invalid log channel 'chanchan'.\n", list); in TEST_F()
352 // Doesn't log, but doesn't assert either in TEST_F()
360 // Test that we are able to concurrently write to a log channel and disable in TEST_F()
364 // Start logging on one thread. Concurrently, try disabling the log channel. in TEST_F()
369 // The log thread either managed to write to the log in time, or it didn't. In in TEST_F()
376 // Test that we are able to concurrently check the verbose flag of a log in TEST_F()
380 // Start logging on one thread. Concurrently, try enabling the log channel in TEST_F()
381 // (with different log options). in TEST_F()
387 // The log thread either managed to write to the log, or it didn't. In either in TEST_F()
394 // Test that we are able to concurrently get mask of a Log object and disable in TEST_F()
398 // Try fetching the log mask on one thread. Concurrently, try disabling the in TEST_F()
399 // log channel. in TEST_F()
407 EXPECT_THAT(mask, testing::AnyOf(0, Log::MaskType(TestChannel::FOO))); in TEST_F()