| 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 | |
| 26 | bool TLogFilter::CheckLoggingContext(TLog& log, const TLogRecordContext& context) { |
no test coverage detected