Example #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));
        }
Example #2
0
File: Log.cs Project: 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));
                }
            }
Example #3
0
File: Log.cs Project: 0xCM/arrows
 FilePath UniqueLogPath <T>(LogTarget <T> target, FileExtension ext = null)
     where T : Enum
 => LogSettings.Get().UniqueLogPath(target, ext);
Example #4
0
File: Log.cs Project: 0xCM/arrows
 FilePath LogPath <T>(LogTarget <T> target)
     where T : Enum
 => LogSettings.Get().LogPath(target);
Example #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}");