MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / Logger

Method Logger

src/Util/Logger.cpp:10–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10Logger::Logger() {
11 // Set up logging framework
12 static std::unique_ptr<LogWorker> gMainLogger = LogWorker::createLogWorker();
13 auto defaultHandler = gMainLogger->addSink(std::make_unique<FileSink>("OpenNFS", LOG_FILE_PATH, ""), &FileSink::fileWrite);
14
15 auto changeFormatting = defaultHandler->call(&FileSink::overrideLogDetails, LogMessage::FullLogDetailsToString);
16 const std::string newHeader = "\t\tLOG format: [hh:mm:ss FILE->FUNCTION:LINE]: message\n\t\t\n\n";
17 auto changeHeader = defaultHandler->call(&FileSink::overrideLogHeader, newHeader);
18 auto coutSinkHandle = gMainLogger->addSink(std::make_unique<ColorCoutSink>(), &ColorCoutSink::ReceiveLogMessage);
19 auto onScreenSinkHandle = gMainLogger->addSink(std::make_unique<OnScreenLogSink>(&onScreenLog), &OnScreenLogSink::ReceiveLogMessage);
20
21 // logger is initialized
22 initializeLogging(gMainLogger.get());
23}
24

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected