From 0f289ca405f779fb5fa931f918adb64d0673cfa5 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 19 Jan 2009 21:38:16 +0000 Subject: change the appender to have a few more colors, none of which are red From: Sean Dague --- OpenSim/Framework/Console/OpenSimAppender.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/OpenSimAppender.cs b/OpenSim/Framework/Console/OpenSimAppender.cs index fa26d22..a11d877 100644 --- a/OpenSim/Framework/Console/OpenSimAppender.cs +++ b/OpenSim/Framework/Console/OpenSimAppender.cs @@ -37,6 +37,21 @@ namespace OpenSim.Framework.Console /// public class OpenSimAppender : AnsiColorTerminalAppender { + private static readonly ConsoleColor[] Colors = { + ConsoleColor.DarkBlue, + ConsoleColor.DarkGreen, + ConsoleColor.DarkCyan, + ConsoleColor.DarkMagenta, + ConsoleColor.DarkYellow, + ConsoleColor.Gray, + ConsoleColor.DarkGray, + ConsoleColor.Blue, + ConsoleColor.Green, + ConsoleColor.Cyan, + ConsoleColor.Magenta, + ConsoleColor.Yellow + }; + override protected void Append(LoggingEvent le) { try @@ -108,8 +123,7 @@ namespace OpenSim.Framework.Console private static ConsoleColor DeriveColor(string input) { - int colIdx = (input.ToUpper().GetHashCode() % 6) + 9; - return (ConsoleColor) colIdx; + return Colors[(input.ToUpper().GetHashCode() % Colors.Length)]; } } } -- cgit v1.1