diff options
Diffstat (limited to 'Common')
-rw-r--r-- | Common/OpenSim.Framework.Console/ConsoleBase.cs | 42 | ||||
-rw-r--r-- | Common/OpenSim.Servers/BaseHttpServer.cs | 6 | ||||
-rw-r--r-- | Common/OpenSim.Servers/CheckSumServer.cs | 3 | ||||
-rw-r--r-- | Common/OpenSim.Servers/LoginResponse.cs | 6 |
4 files changed, 37 insertions, 20 deletions
diff --git a/Common/OpenSim.Framework.Console/ConsoleBase.cs b/Common/OpenSim.Framework.Console/ConsoleBase.cs index 6a1c53c..160b8f6 100644 --- a/Common/OpenSim.Framework.Console/ConsoleBase.cs +++ b/Common/OpenSim.Framework.Console/ConsoleBase.cs | |||
@@ -41,29 +41,49 @@ namespace OpenSim.Framework.Console | |||
41 | 41 | ||
42 | public void Write(string format, params object[] args) | 42 | public void Write(string format, params object[] args) |
43 | { | 43 | { |
44 | WriteLine(LogPriority.NORMAL,format,args); | 44 | Notice(format,args); |
45 | return; | 45 | return; |
46 | } | 46 | } |
47 | 47 | ||
48 | [Obsolete("WriteLine(msg,args) has been depreciated, use WriteLine(priority,msg,args) instead.")] | 48 | public void Warn(string format, params object[] args) |
49 | public void WriteLine(string format, params object[] args) | ||
50 | { | 49 | { |
51 | Log.WriteLine(format, args); | 50 | WriteNewLine(ConsoleColor.Yellow, format, args); |
52 | Log.Flush(); | 51 | return; |
53 | if(!m_silent) | 52 | } |
54 | { | 53 | |
55 | System.Console.WriteLine(format, args); | 54 | public void Notice(string format, params object[] args) |
56 | } | 55 | { |
56 | WriteNewLine(ConsoleColor.White, format, args); | ||
57 | return; | ||
58 | } | ||
59 | |||
60 | public void Error(string format, params object[] args) | ||
61 | { | ||
62 | WriteNewLine(ConsoleColor.Red, format, args); | ||
63 | return; | ||
64 | } | ||
65 | |||
66 | public void Verbose(string format, params object[] args) | ||
67 | { | ||
68 | WriteNewLine(ConsoleColor.Gray, format, args); | ||
69 | return; | ||
70 | } | ||
71 | |||
72 | public void Status(string format, params object[] args) | ||
73 | { | ||
74 | WriteNewLine(ConsoleColor.Blue, format, args); | ||
57 | return; | 75 | return; |
58 | } | 76 | } |
59 | 77 | ||
60 | public void WriteLine(LogPriority importance, string format, params object[] args) | 78 | private void WriteNewLine(System.ConsoleColor color, string format, params object[] args) |
61 | { | 79 | { |
62 | Log.WriteLine(format, args); | 80 | Log.WriteLine(format, args); |
63 | Log.Flush(); | 81 | Log.Flush(); |
64 | if (!m_silent) | 82 | if (!m_silent) |
65 | { | 83 | { |
84 | System.Console.ForegroundColor = color; | ||
66 | System.Console.WriteLine(format, args); | 85 | System.Console.WriteLine(format, args); |
86 | System.Console.ResetColor(); | ||
67 | } | 87 | } |
68 | return; | 88 | return; |
69 | } | 89 | } |
@@ -130,7 +150,7 @@ namespace OpenSim.Framework.Console | |||
130 | } | 150 | } |
131 | else | 151 | else |
132 | { | 152 | { |
133 | this.WriteLine(LogPriority.MEDIUM,"Valid options are " + OptionA + " or " + OptionB); | 153 | Notice("Valid options are " + OptionA + " or " + OptionB); |
134 | temp = CmdPrompt(prompt, defaultresponse); | 154 | temp = CmdPrompt(prompt, defaultresponse); |
135 | } | 155 | } |
136 | } | 156 | } |
diff --git a/Common/OpenSim.Servers/BaseHttpServer.cs b/Common/OpenSim.Servers/BaseHttpServer.cs index 38f4370..3f9109d 100644 --- a/Common/OpenSim.Servers/BaseHttpServer.cs +++ b/Common/OpenSim.Servers/BaseHttpServer.cs | |||
@@ -223,7 +223,7 @@ namespace OpenSim.Servers | |||
223 | 223 | ||
224 | public void Start() | 224 | public void Start() |
225 | { | 225 | { |
226 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server"); | 226 | MainConsole.Instance.Verbose("BaseHttpServer.cs: Starting up HTTP Server"); |
227 | 227 | ||
228 | m_workerThread = new Thread(new ThreadStart(StartHTTP)); | 228 | m_workerThread = new Thread(new ThreadStart(StartHTTP)); |
229 | m_workerThread.IsBackground = true; | 229 | m_workerThread.IsBackground = true; |
@@ -234,7 +234,7 @@ namespace OpenSim.Servers | |||
234 | { | 234 | { |
235 | try | 235 | try |
236 | { | 236 | { |
237 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); | 237 | MainConsole.Instance.Verbose("BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); |
238 | m_httpListener = new HttpListener(); | 238 | m_httpListener = new HttpListener(); |
239 | 239 | ||
240 | m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); | 240 | m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); |
@@ -249,7 +249,7 @@ namespace OpenSim.Servers | |||
249 | } | 249 | } |
250 | catch (Exception e) | 250 | catch (Exception e) |
251 | { | 251 | { |
252 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM, e.Message); | 252 | MainConsole.Instance.Warn(e.Message); |
253 | } | 253 | } |
254 | } | 254 | } |
255 | } | 255 | } |
diff --git a/Common/OpenSim.Servers/CheckSumServer.cs b/Common/OpenSim.Servers/CheckSumServer.cs index 1125baf..280eb82 100644 --- a/Common/OpenSim.Servers/CheckSumServer.cs +++ b/Common/OpenSim.Servers/CheckSumServer.cs | |||
@@ -100,8 +100,7 @@ namespace OpenSim.Servers | |||
100 | } | 100 | } |
101 | catch (Exception) | 101 | catch (Exception) |
102 | { | 102 | { |
103 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection "); | 103 | MainConsole.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection "); |
104 | |||
105 | } | 104 | } |
106 | } | 105 | } |
107 | 106 | ||
diff --git a/Common/OpenSim.Servers/LoginResponse.cs b/Common/OpenSim.Servers/LoginResponse.cs index 7333d1f..e78def4 100644 --- a/Common/OpenSim.Servers/LoginResponse.cs +++ b/Common/OpenSim.Servers/LoginResponse.cs | |||
@@ -210,8 +210,7 @@ namespace OpenSim.UserServer | |||
210 | } | 210 | } |
211 | catch (Exception e) | 211 | catch (Exception e) |
212 | { | 212 | { |
213 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine( | 213 | OpenSim.Framework.Console.MainConsole.Instance.Warn( |
214 | OpenSim.Framework.Console.LogPriority.LOW, | ||
215 | "LoginResponse: Unable to set default values: " + e.Message | 214 | "LoginResponse: Unable to set default values: " + e.Message |
216 | ); | 215 | ); |
217 | } | 216 | } |
@@ -326,8 +325,7 @@ namespace OpenSim.UserServer | |||
326 | } | 325 | } |
327 | catch (Exception e) | 326 | catch (Exception e) |
328 | { | 327 | { |
329 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine( | 328 | OpenSim.Framework.Console.MainConsole.Instance.Error( |
330 | OpenSim.Framework.Console.LogPriority.LOW, | ||
331 | "LoginResponse: Error creating XML-RPC Response: " + e.Message | 329 | "LoginResponse: Error creating XML-RPC Response: " + e.Message |
332 | ); | 330 | ); |
333 | return (this.GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); | 331 | return (this.GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); |