public void Write(Severity type, object context, string format) { WriteCore(type, context, Localize.From(format)); }
protected virtual ConsoleColor PickColor(Severity msgType, out string msgTypeText) { bool implicitText = msgType < PrintSeverityAt; ConsoleColor color; if (msgType >= Severity.Critical) { color = ConsoleColor.Magenta; } else if (msgType >= Severity.Error) { color = ConsoleColor.Red; } else if (msgType >= Severity.Warning) { color = ConsoleColor.Yellow; } else if (msgType >= Severity.Note) { color = ConsoleColor.White; } else if (msgType >= Severity.Debug) { color = ConsoleColor.Cyan; } else if (msgType >= Severity.Verbose || msgType == Severity._Finer) { color = ConsoleColor.DarkCyan; } else if (msgType == Severity.Detail) { switch (_lastColor) { case ConsoleColor.Red: color = ConsoleColor.DarkRed; break; case ConsoleColor.Yellow: color = ConsoleColor.DarkYellow; break; case ConsoleColor.White: color = ConsoleColor.Gray; break; case ConsoleColor.Green: color = ConsoleColor.DarkGreen; break; case ConsoleColor.Blue: color = ConsoleColor.DarkBlue; break; case ConsoleColor.Magenta: color = ConsoleColor.DarkMagenta; break; case ConsoleColor.Cyan: color = ConsoleColor.DarkCyan; break; default: color = ConsoleColor.DarkGray; break; } msgTypeText = null; return(color); } else { color = Console.ForegroundColor; } msgTypeText = implicitText ? null : Localize.From(msgType.ToString()); _lastColor = color; return(color); }
public void Write(Severity type, object context, string format, object arg0, object arg1 = null) { WriteCore(type, context, Localize.From(format, arg0, arg1)); }
public void Write(Severity type, object context, string format, params object[] args) { WriteCore(type, context, Localize.From(format, args)); }
public override string ToString() { return(Localize.From("(No value)")); }