MCPcopy Create free account
hub / github.com/catboost/catboost / PrepareToOpenLog

Function PrepareToOpenLog

library/cpp/logger/global/common.cpp:11–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9 }
10
11 TString PrepareToOpenLog(TString logType, const int logLevel, const bool rotation, const bool startAsDaemon) {
12 Y_ENSURE(logLevel >= 0 && logLevel <= (int)LOG_MAX_PRIORITY, "Incorrect log level");
13
14 if (rotation && TFsPath(logType).Exists()) {
15 TString newPath = Sprintf("%s_%s_%" PRIu64, logType.data(), NLoggingImpl::GetLocalTimeSSimple().data(), static_cast<ui64>(Now().MicroSeconds()));
16 TFsPath(logType).RenameTo(newPath);
17 }
18 if (startAsDaemon && (logType == "console"sv || logType == "cout"sv || logType == "cerr"sv)) {
19 logType = "null";
20 }
21
22 return logType;
23 }
24}
25
26bool TLogFilter::CheckLoggingContext(TLog& log, const TLogRecordContext& context) {

Callers 2

DoInitGlobalLogFunction · 0.85
InitLogImplFunction · 0.85

Calls 8

SprintfFunction · 0.85
GetLocalTimeSSimpleFunction · 0.85
RenameToMethod · 0.80
TFsPathClass · 0.50
NowFunction · 0.50
ExistsMethod · 0.45
dataMethod · 0.45
MicroSecondsMethod · 0.45

Tested by

no test coverage detected