public void Log(LogValue value) { var path = Path.Combine(Folder, value.Application ?? "Default", $"{value.Time:yyyy-MM}", $"{value.Action}-{value.Time:yy-MM-dd}.log"); var text = value.GetText(); try { File.AppendAllText(path, text); } catch { var fileInfo = new FileInfo(path); Directory.CreateDirectory(fileInfo.DirectoryName); File.AppendAllText(path, text); } }
public void Log(LogValue value) => Debug.Write(value.GetText());
public void Log(LogValue value) => Console.WriteLine(value.GetText());