Пример #1
0
        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));
        }
Пример #2
0
Файл: Log.cs Проект: 0xCM/arrows
            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));
                }
            }
Пример #3
0
Файл: Log.cs Проект: 0xCM/arrows
 FilePath UniqueLogPath <T>(LogTarget <T> target, FileExtension ext = null)
     where T : Enum
 => LogSettings.Get().UniqueLogPath(target, ext);
Пример #4
0
Файл: Log.cs Проект: 0xCM/arrows
 FilePath LogPath <T>(LogTarget <T> target)
     where T : Enum
 => LogSettings.Get().LogPath(target);
Пример #5
0
 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}");