diff options
author | Melanie Thielker | 2009-05-20 13:50:33 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-05-20 13:50:33 +0000 |
commit | 4065ebff15e228d7227500f3a2275025f5d16966 (patch) | |
tree | 3ffddea94c9fab8218289c5bc4e188e9f52a53c2 /OpenSim/Framework/Console/LocalConsole.cs | |
parent | refactoring instantiation of Location object: moving it out of the for (diff) | |
download | opensim-SC-4065ebff15e228d7227500f3a2275025f5d16966.zip opensim-SC-4065ebff15e228d7227500f3a2275025f5d16966.tar.gz opensim-SC-4065ebff15e228d7227500f3a2275025f5d16966.tar.bz2 opensim-SC-4065ebff15e228d7227500f3a2275025f5d16966.tar.xz |
Remove the pre-log4net, discrete output methods from the consoles
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Console/LocalConsole.cs | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index 22f10fc..ca57bd6 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs | |||
@@ -62,19 +62,6 @@ namespace OpenSim.Framework.Console | |||
62 | history.Add(text); | 62 | history.Add(text); |
63 | } | 63 | } |
64 | 64 | ||
65 | /// <summary> | ||
66 | /// derive an ansi color from a string, ignoring the darker colors. | ||
67 | /// This is used to help automatically bin component tags with colors | ||
68 | /// in various print functions. | ||
69 | /// </summary> | ||
70 | /// <param name="input">arbitrary string for input</param> | ||
71 | /// <returns>an ansii color</returns> | ||
72 | protected override ConsoleColor DeriveColor(string input) | ||
73 | { | ||
74 | int colIdx = (input.ToUpper().GetHashCode() % 6) + 9; | ||
75 | return (ConsoleColor) colIdx; | ||
76 | } | ||
77 | |||
78 | private int SetCursorTop(int top) | 65 | private int SetCursorTop(int top) |
79 | { | 66 | { |
80 | if (top >= 0 && top < System.Console.BufferHeight) | 67 | if (top >= 0 && top < System.Console.BufferHeight) |
@@ -101,117 +88,6 @@ namespace OpenSim.Framework.Console | |||
101 | } | 88 | } |
102 | } | 89 | } |
103 | 90 | ||
104 | protected override void WriteNewLine(ConsoleColor senderColor, string sender, ConsoleColor color, string format, params object[] args) | ||
105 | { | ||
106 | lock (cmdline) | ||
107 | { | ||
108 | if (y != -1) | ||
109 | { | ||
110 | y=SetCursorTop(y); | ||
111 | System.Console.CursorLeft = 0; | ||
112 | |||
113 | int count = cmdline.Length; | ||
114 | |||
115 | System.Console.Write(" "); | ||
116 | while (count-- > 0) | ||
117 | System.Console.Write(" "); | ||
118 | |||
119 | y=SetCursorTop(y); | ||
120 | System.Console.CursorLeft = 0; | ||
121 | } | ||
122 | WritePrefixLine(senderColor, sender); | ||
123 | WriteConsoleLine(color, format, args); | ||
124 | if (y != -1) | ||
125 | y = System.Console.CursorTop; | ||
126 | } | ||
127 | } | ||
128 | |||
129 | protected override void WriteNewLine(ConsoleColor color, string format, params object[] args) | ||
130 | { | ||
131 | lock (cmdline) | ||
132 | { | ||
133 | if (y != -1) | ||
134 | { | ||
135 | y=SetCursorTop(y); | ||
136 | System.Console.CursorLeft = 0; | ||
137 | |||
138 | int count = cmdline.Length; | ||
139 | |||
140 | System.Console.Write(" "); | ||
141 | while (count-- > 0) | ||
142 | System.Console.Write(" "); | ||
143 | |||
144 | y=SetCursorTop(y); | ||
145 | System.Console.CursorLeft = 0; | ||
146 | } | ||
147 | WriteConsoleLine(color, format, args); | ||
148 | if (y != -1) | ||
149 | y = System.Console.CursorTop; | ||
150 | } | ||
151 | } | ||
152 | |||
153 | protected override void WriteConsoleLine(ConsoleColor color, string format, params object[] args) | ||
154 | { | ||
155 | try | ||
156 | { | ||
157 | lock (m_syncRoot) | ||
158 | { | ||
159 | try | ||
160 | { | ||
161 | if (color != ConsoleColor.White) | ||
162 | System.Console.ForegroundColor = color; | ||
163 | |||
164 | System.Console.WriteLine(format, args); | ||
165 | System.Console.ResetColor(); | ||
166 | } | ||
167 | catch (ArgumentNullException) | ||
168 | { | ||
169 | // Some older systems dont support coloured text. | ||
170 | System.Console.WriteLine(format, args); | ||
171 | } | ||
172 | catch (FormatException) | ||
173 | { | ||
174 | System.Console.WriteLine(args); | ||
175 | } | ||
176 | } | ||
177 | } | ||
178 | catch (ObjectDisposedException) | ||
179 | { | ||
180 | } | ||
181 | } | ||
182 | |||
183 | protected override void WritePrefixLine(ConsoleColor color, string sender) | ||
184 | { | ||
185 | try | ||
186 | { | ||
187 | lock (m_syncRoot) | ||
188 | { | ||
189 | sender = sender.ToUpper(); | ||
190 | |||
191 | System.Console.WriteLine("[" + sender + "] "); | ||
192 | |||
193 | System.Console.Write("["); | ||
194 | |||
195 | try | ||
196 | { | ||
197 | System.Console.ForegroundColor = color; | ||
198 | System.Console.Write(sender); | ||
199 | System.Console.ResetColor(); | ||
200 | } | ||
201 | catch (ArgumentNullException) | ||
202 | { | ||
203 | // Some older systems dont support coloured text. | ||
204 | System.Console.WriteLine(sender); | ||
205 | } | ||
206 | |||
207 | System.Console.Write("] \t"); | ||
208 | } | ||
209 | } | ||
210 | catch (ObjectDisposedException) | ||
211 | { | ||
212 | } | ||
213 | } | ||
214 | |||
215 | private void Show() | 91 | private void Show() |
216 | { | 92 | { |
217 | lock (cmdline) | 93 | lock (cmdline) |