diff options
author | Adam Frisby | 2007-06-05 12:55:12 +0000 |
---|---|---|
committer | Adam Frisby | 2007-06-05 12:55:12 +0000 |
commit | 1e716260c8166005d3bd33f4cda68502a09994bb (patch) | |
tree | 457d68f241ca0d8b28e03fdcd1a93f6aaf75ec44 /Common/OpenSim.Framework.Console/ConsoleBase.cs | |
parent | * Removing dead comments (diff) | |
download | opensim-SC-1e716260c8166005d3bd33f4cda68502a09994bb.zip opensim-SC-1e716260c8166005d3bd33f4cda68502a09994bb.tar.gz opensim-SC-1e716260c8166005d3bd33f4cda68502a09994bb.tar.bz2 opensim-SC-1e716260c8166005d3bd33f4cda68502a09994bb.tar.xz |
* Removed MainConsole.Instance.WriteLine completely
* Now exists MainConsole.Instance.Error/Warn/Notice/Verbose -- use those instead
* Removed some instances of System.Console use - aiming to depreciate this in favour of MainConsole completely.
Diffstat (limited to 'Common/OpenSim.Framework.Console/ConsoleBase.cs')
-rw-r--r-- | Common/OpenSim.Framework.Console/ConsoleBase.cs | 42 |
1 files changed, 31 insertions, 11 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 | } |