private void DetectThatNewFileWasCreated() { if (NewLogFileWasCreated()) { observer.FileWasRolled(logFileName, GetNewLogFileName()); } }
/// <summary> /// вызов сделал снаружи, по сути должна быть внутренняя логика выхова этого метода /// </summary> public void DetectThatNewFileWasCreated() { if (IfNewFileWasCreated()) { _obsrerver.FileWasRolled(_fileName, newLogFile: GetNewFileName()); } }
// added new logic that checks that logger stopped writing to current log file // and switched to new one private void DetectThatNewFileWasCreated(object state) { // this method is called via timer if (NewLogFileWasCreated()) { _logFileReaderObserver.FileWasRolled(_logFileName, GetNewLogFileName()); } }