public void Info(FileInfo file, string message) { logs.Add(KeyValueLog.New(KeyValueLogType.Info, file, message)); if (ShowProcess && OutputFilter != KeyValueLogType.Warning && OutputFilter != KeyValueLogType.Error) { string fn = file != null ? file.FullName : ""; $"INFO: {fn}".Out(); message.Out(); } }
public static KeyValueLog New(KeyValueLogType type, FileInfo file, string what) { var result = new KeyValueLog() { LogType = type, When = DateTime.Now, File = file, What = what }; return(result); }
public void Error(FileInfo file, string message) { Status = ProcessStatus.Errors; logs.Add(KeyValueLog.New(KeyValueLogType.Error, file, message)); if (ShowProcess) { string fn = file != null ? file.FullName : ""; $"ERROR: {fn}".OutRed(); message.OutRed(); } }
public void Warning(FileInfo file, string message) { if (Status == ProcessStatus.Ok) { Status = ProcessStatus.Warnings; } logs.Add(KeyValueLog.New(KeyValueLogType.Warning, file, message)); if (ShowProcess && OutputFilter != KeyValueLogType.Error) { string fn = file != null ? file.FullName : ""; $"WARNING: {fn}".OutYellow(); message.OutYellow(); } }