public void LogCore(PackingException exception, string type) { var color = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; var builder = new StringBuilder(); if (!string.IsNullOrWhiteSpace(exception.File)) { builder.Append(exception.File); } builder.Append(type); if (!string.IsNullOrWhiteSpace(exception.Key)) { builder.Append($" {exception.Key}"); } builder.Append(": "); builder.Append(exception.Message); Console.ForegroundColor = color; }
public void Warning(PackingException exception) { var message = exception.Message; if (!string.IsNullOrEmpty(exception.Key)) { message = exception.Key + ": " + exception.Message; } Warning(message, targetFile: exception.File); }
public void Error(PackingException exception) { LogCore(exception, "error"); }
public void Warning(PackingException exception) { LogCore(exception, "warning"); }