aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Console/ConsoleBase.cs
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-20 13:50:33 +0000
committerMelanie Thielker2009-05-20 13:50:33 +0000
commit4065ebff15e228d7227500f3a2275025f5d16966 (patch)
tree3ffddea94c9fab8218289c5bc4e188e9f52a53c2 /OpenSim/Framework/Console/ConsoleBase.cs
parentrefactoring instantiation of Location object: moving it out of the for (diff)
downloadopensim-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/ConsoleBase.cs148
1 files changed, 0 insertions, 148 deletions
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs
index dd3c145..0747ae5 100644
--- a/OpenSim/Framework/Console/ConsoleBase.cs
+++ b/OpenSim/Framework/Console/ConsoleBase.cs
@@ -58,154 +58,6 @@ namespace OpenSim.Framework.Console
58 DefaultPrompt = defaultPrompt; 58 DefaultPrompt = defaultPrompt;
59 } 59 }
60 60
61 /// <summary>
62 /// derive an ansi color from a string, ignoring the darker colors.
63 /// This is used to help automatically bin component tags with colors
64 /// in various print functions.
65 /// </summary>
66 /// <param name="input">arbitrary string for input</param>
67 /// <returns>an ansii color</returns>
68 protected virtual ConsoleColor DeriveColor(string input)
69 {
70 return ConsoleColor.White;
71 }
72
73 /// <summary>
74 /// Sends a warning to the current console output
75 /// </summary>
76 /// <param name="format">The message to send</param>
77 /// <param name="args">WriteLine-style message arguments</param>
78 public void Warn(string format, params object[] args)
79 {
80 WriteNewLine(ConsoleColor.Yellow, format, args);
81 }
82
83 /// <summary>
84 /// Sends a warning to the current console output
85 /// </summary>
86 /// <param name="sender">The module that sent this message</param>
87 /// <param name="format">The message to send</param>
88 /// <param name="args">WriteLine-style message arguments</param>
89 public void Warn(string sender, string format, params object[] args)
90 {
91 WriteNewLine(DeriveColor(sender), sender, ConsoleColor.Yellow, format, args);
92 }
93
94 /// <summary>
95 /// Sends a notice to the current console output
96 /// </summary>
97 /// <param name="format">The message to send</param>
98 /// <param name="args">WriteLine-style message arguments</param>
99 public void Notice(string format, params object[] args)
100 {
101 WriteNewLine(ConsoleColor.White, format, args);
102 }
103
104 /// <summary>
105 /// Sends a notice to the current console output
106 /// </summary>
107 /// <param name="sender">The module that sent this message</param>
108 /// <param name="format">The message to send</param>
109 /// <param name="args">WriteLine-style message arguments</param>
110 public void Notice(string sender, string format, params object[] args)
111 {
112 WriteNewLine(DeriveColor(sender), sender, ConsoleColor.White, format, args);
113 }
114 /// <summary>
115 /// Sends an error to the current console output
116 /// </summary>
117 /// <param name="format">The message to send</param>
118 /// <param name="args">WriteLine-style message arguments</param>
119 public void Error(string format, params object[] args)
120 {
121 WriteNewLine(ConsoleColor.Red, format, args);
122 }
123
124 /// <summary>
125 /// Sends an error to the current console output
126 /// </summary>
127 /// <param name="sender">The module that sent this message</param>
128 /// <param name="format">The message to send</param>
129 /// <param name="args">WriteLine-style message arguments</param>
130 public void Error(string sender, string format, params object[] args)
131 {
132 WriteNewLine(DeriveColor(sender), sender, ConsoleColor.Red, format, args);
133 }
134
135 /// <summary>
136 /// Sends a status message to the current console output
137 /// </summary>
138 /// <param name="format">The message to send</param>
139 /// <param name="args">WriteLine-style message arguments</param>
140 public void Status(string format, params object[] args)
141 {
142 WriteNewLine(ConsoleColor.Blue, format, args);
143 }
144
145 /// <summary>
146 /// Sends a status message to the current console output
147 /// </summary>
148 /// <param name="sender">The module that sent this message</param>
149 /// <param name="format">The message to send</param>
150 /// <param name="args">WriteLine-style message arguments</param>
151 public void Status(string sender, string format, params object[] args)
152 {
153 WriteNewLine(DeriveColor(sender), sender, ConsoleColor.Blue, format, args);
154 }
155
156 [Conditional("DEBUG")]
157 public void Debug(string format, params object[] args)
158 {
159 WriteNewLine(ConsoleColor.Gray, format, args);
160 }
161
162 [Conditional("DEBUG")]
163 public void Debug(string sender, string format, params object[] args)
164 {
165 WriteNewLine(DeriveColor(sender), sender, ConsoleColor.Gray, format, args);
166 }
167
168 protected virtual void WriteNewLine(ConsoleColor senderColor, string sender, ConsoleColor color, string format, params object[] args)
169 {
170 WritePrefixLine(senderColor, sender);
171 WriteConsoleLine(color, format, args);
172 }
173
174 protected virtual void WriteNewLine(ConsoleColor color, string format, params object[] args)
175 {
176 WriteConsoleLine(color, format, args);
177 }
178
179 protected virtual void WriteConsoleLine(ConsoleColor color, string format, params object[] args)
180 {
181 try
182 {
183 System.Console.WriteLine(format, args);
184 }
185 catch (ObjectDisposedException)
186 {
187 }
188 }
189
190 protected virtual void WritePrefixLine(ConsoleColor color, string sender)
191 {
192 try
193 {
194 sender = sender.ToUpper();
195
196 System.Console.WriteLine("[" + sender + "] ");
197
198 System.Console.Write("[");
199
200 System.Console.Write(sender);
201
202 System.Console.Write("] \t");
203 }
204 catch (ObjectDisposedException)
205 {
206 }
207 }
208
209 public virtual void LockOutput() 61 public virtual void LockOutput()
210 { 62 {
211 } 63 }