aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/Console/LogBase.cs43
1 files changed, 18 insertions, 25 deletions
diff --git a/OpenSim/Framework/Console/LogBase.cs b/OpenSim/Framework/Console/LogBase.cs
index 6b6c056..a088af8 100644
--- a/OpenSim/Framework/Console/LogBase.cs
+++ b/OpenSim/Framework/Console/LogBase.cs
@@ -96,6 +96,19 @@ namespace OpenSim.Framework.Console
96 } 96 }
97 97
98 /// <summary> 98 /// <summary>
99 /// derive an ansi color from a string, ignoring the darker colors.
100 /// This is used to help automatically bin component tags with colors
101 /// in various print functions.
102 /// </summary>
103 /// <param name="input">arbitrary string for input</param>
104 /// <returns>an ansii color</returns>
105 private ConsoleColor DeriveColor(string input)
106 {
107 int colIdx = (input.ToUpper().GetHashCode() % 6) + 9;
108 return (ConsoleColor)colIdx;
109 }
110
111 /// <summary>
99 /// Sends a warning to the current log output 112 /// Sends a warning to the current log output
100 /// </summary> 113 /// </summary>
101 /// <param name="format">The message to send</param> 114 /// <param name="format">The message to send</param>
@@ -114,11 +127,7 @@ namespace OpenSim.Framework.Console
114 /// <param name="args">WriteLine-style message arguments</param> 127 /// <param name="args">WriteLine-style message arguments</param>
115 public void Warn(string sender, string format, params object[] args) 128 public void Warn(string sender, string format, params object[] args)
116 { 129 {
117 sender = sender.ToUpper(); 130 WritePrefixLine(DeriveColor(sender), sender);
118 int colIdx = (sender.GetHashCode() % 6) + 9;
119 ConsoleColor col = (ConsoleColor)colIdx;
120
121 WritePrefixLine(col, sender);
122 WriteNewLine(ConsoleColor.Yellow, format, args); 131 WriteNewLine(ConsoleColor.Yellow, format, args);
123 return; 132 return;
124 } 133 }
@@ -142,11 +151,7 @@ namespace OpenSim.Framework.Console
142 /// <param name="args">WriteLine-style message arguments</param> 151 /// <param name="args">WriteLine-style message arguments</param>
143 public void Notice(string sender, string format, params object[] args) 152 public void Notice(string sender, string format, params object[] args)
144 { 153 {
145 sender = sender.ToUpper(); 154 WritePrefixLine(DeriveColor(sender), sender);
146 int colIdx = (sender.GetHashCode() % 6) + 9;
147 ConsoleColor col = (ConsoleColor)colIdx;
148
149 WritePrefixLine(col, sender);
150 WriteNewLine(ConsoleColor.White, format, args); 155 WriteNewLine(ConsoleColor.White, format, args);
151 return; 156 return;
152 } 157 }
@@ -170,11 +175,7 @@ namespace OpenSim.Framework.Console
170 /// <param name="args">WriteLine-style message arguments</param> 175 /// <param name="args">WriteLine-style message arguments</param>
171 public void Error(string sender, string format, params object[] args) 176 public void Error(string sender, string format, params object[] args)
172 { 177 {
173 sender = sender.ToUpper(); 178 WritePrefixLine(DeriveColor(sender), sender);
174 int colIdx = (sender.GetHashCode() % 6) + 9;
175 ConsoleColor col = (ConsoleColor)colIdx;
176
177 WritePrefixLine(col, sender);
178 WriteNewLine(ConsoleColor.Red, format, args); 179 WriteNewLine(ConsoleColor.Red, format, args);
179 return; 180 return;
180 } 181 }
@@ -198,11 +199,7 @@ namespace OpenSim.Framework.Console
198 /// <param name="args">WriteLine-style message arguments</param> 199 /// <param name="args">WriteLine-style message arguments</param>
199 public void Verbose(string sender, string format, params object[] args) 200 public void Verbose(string sender, string format, params object[] args)
200 { 201 {
201 sender = sender.ToUpper(); 202 WritePrefixLine(DeriveColor(sender), sender);
202 int colIdx = (sender.GetHashCode() % 6) + 9;
203 ConsoleColor col = (ConsoleColor)colIdx;
204
205 WritePrefixLine(col, sender);
206 WriteNewLine(ConsoleColor.Gray, format, args); 203 WriteNewLine(ConsoleColor.Gray, format, args);
207 return; 204 return;
208 } 205 }
@@ -226,11 +223,7 @@ namespace OpenSim.Framework.Console
226 /// <param name="args">WriteLine-style message arguments</param> 223 /// <param name="args">WriteLine-style message arguments</param>
227 public void Status(string sender, string format, params object[] args) 224 public void Status(string sender, string format, params object[] args)
228 { 225 {
229 sender = sender.ToUpper(); 226 WritePrefixLine(DeriveColor(sender), sender);
230 int colIdx = (sender.GetHashCode() % 6) + 9;
231 ConsoleColor col = (ConsoleColor)colIdx;
232
233 WritePrefixLine(col, sender);
234 WriteNewLine(ConsoleColor.Blue, format, args); 227 WriteNewLine(ConsoleColor.Blue, format, args);
235 return; 228 return;
236 } 229 }