protected void PrintMessage(Msg msg) { string level = ""; ConsoleColor color = ConsoleColor.Gray; if (msg.Level == Msg.LEVEL.DEBUG) { color = ConsoleColor.Cyan; level = "DBG"; } else if (msg.Level == Msg.LEVEL.INFO) { color = ConsoleColor.Blue; level = "INF"; } else if (msg.Level == Msg.LEVEL.WARN) { color = ConsoleColor.Yellow; level = "WRN"; } else if (msg.Level == Msg.LEVEL.ERROR) { color = ConsoleColor.Red; level = "ERR"; } else if (msg.Level == Msg.LEVEL.SUCCESS) { color = ConsoleColor.Green; level = "SUC"; } CoEx.SetColor(null, color); CoEx.Write("[{0}] ", level); CoEx.ResetColor(); CoEx.WriteLine(msg.ToString()); }
public void ApplyBackground() { CoEx.SetColor(this.Background, null); }
public void Apply() { CoEx.SetColor(this.Background, this.Foreground); }
public void ApplyForeground() { CoEx.SetColor(null, this.Foreground); }