MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / LogSetup

Method LogSetup

src/test/logging_tests.cpp:63–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 BCLog::CategoryMask prev_category_mask;
62
63 LogSetup() : prev_log_path{LogInstance().m_file_path},
64 tmp_log_path{m_args.GetDataDirBase() / "tmp_debug.log"},
65 prev_reopen_file{LogInstance().m_reopen_file},
66 prev_print_to_file{LogInstance().m_print_to_file},
67 prev_log_timestamps{LogInstance().m_log_timestamps},
68 prev_log_threadnames{LogInstance().m_log_threadnames},
69 prev_log_sourcelocations{LogInstance().m_log_sourcelocations},
70 prev_category_levels{LogInstance().CategoryLevels()},
71 prev_log_level{LogInstance().LogLevel()},
72 prev_category_mask{LogInstance().GetCategoryMask()}
73 {
74 LogInstance().m_file_path = tmp_log_path;
75 LogInstance().m_reopen_file = true;
76 LogInstance().m_print_to_file = true;
77 LogInstance().m_log_timestamps = false;
78 LogInstance().m_log_threadnames = false;
79
80 // Prevent tests from failing when the line number of the logs changes.
81 LogInstance().m_log_sourcelocations = false;
82
83 LogInstance().SetLogLevel(BCLog::Level::Debug);
84 LogInstance().DisableCategory(BCLog::LogFlags::ALL);
85 LogInstance().SetCategoryLogLevel({});
86 LogInstance().SetRateLimiting(nullptr);
87 }
88
89 ~LogSetup()
90 {

Callers

nothing calls this directly

Calls 6

GetDataDirBaseMethod · 0.80
LogLevelMethod · 0.80
GetCategoryMaskMethod · 0.80
DisableCategoryMethod · 0.80
SetCategoryLogLevelMethod · 0.80
SetLogLevelMethod · 0.45

Tested by

no test coverage detected