public FilePath UniqueLogPath <T>(LogTarget <T> target, FileExtension ext = null) where T : Enum { var first = new DateTime(2019, 1, 1); var current = now(); var elapsed = (long)(current - first).TotalMilliseconds; return(LogPath(target, ext, elapsed)); }
public void Log <R, T>(IEnumerable <R> records, LogTarget <T> target, char delimiter, bool writeHeader = true, bool newFile = true, FileExtension ext = null) where R : IRecord where T : Enum { var frozen = records.ToArray(); if (frozen.Length == 0) { return; } if (newFile) { LogRecords(frozen, delimiter, writeHeader, UniqueLogPath(target, ext)); } else { lock (locker) LogRecords(frozen, delimiter, writeHeader, LogPath(target)); } }
FilePath UniqueLogPath <T>(LogTarget <T> target, FileExtension ext = null) where T : Enum => LogSettings.Get().UniqueLogPath(target, ext);
FilePath LogPath <T>(LogTarget <T> target) where T : Enum => LogSettings.Get().LogPath(target);
public FilePath LogPath <T>(LogTarget <T> target, FileExtension ext = null, long?timestamp = null) where T : Enum => LogDir(target.Area) + FileName.Define($"{target.Area}.{target.KindName}.{timestamp ?? LogDate}.{ext ?? DefaultExtension}");