MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / InitializeFromConfig

Method InitializeFromConfig

engine/Poseidon/Foundation/Logging/Logging.cpp:641–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639}
640
641void LoggingSystem::InitializeFromConfig(const char* appPrefix)
642{
643 auto& cfg = AppConfig::Instance();
644 const auto& logFile = cfg.GetLogFile();
645 Initialize(cfg.GetLogLevel().c_str(), cfg.GetLogCategories().c_str(), cfg.GetLogFormat().c_str(),
646 logFile.empty() ? nullptr : logFile.c_str());
647 SetStrictMode(cfg.Strict());
648
649 const auto& cliTag = cfg.GetAppTag();
650 if (!cliTag.empty())
651 {
652 SetAppTag(cliTag.c_str());
653 }
654 else
655 {
656 char tag[12];
657 snprintf(tag, sizeof(tag), "%.3s-%04x", appPrefix, (unsigned)getpid() & 0xFFFF);
658 SetAppTag(tag);
659 }
660}
661
662} // namespace Poseidon::Foundation

Callers 1

ParseCommandLineMethod · 0.80

Calls 3

StrictMethod · 0.80
GetAppTagMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected