diff options
Added a Debug method to the Console/log class that has the Conditional attribute (set to "DEBUG"), so we can use that for writing extra debug info to the console. [for anyone who doesn't know about the Conditional attribute, it is a attribute that can be set on a method, and then any call to that method will on be compiled if the terms of that condition are met, ie is this case only if "DEBUG" is true. So its a cleaner implementation of the #if #endif directives].
A few other minor changes.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Console/LogBase.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/OpenSim/Framework/Console/LogBase.cs b/OpenSim/Framework/Console/LogBase.cs index 5f16303..119c2cd 100644 --- a/OpenSim/Framework/Console/LogBase.cs +++ b/OpenSim/Framework/Console/LogBase.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Net; | 30 | using System.Net; |
31 | using System.Diagnostics; | ||
31 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
32 | 33 | ||
33 | namespace OpenSim.Framework.Console | 34 | namespace OpenSim.Framework.Console |
@@ -228,7 +229,21 @@ namespace OpenSim.Framework.Console | |||
228 | WriteNewLine(ConsoleColor.Blue, format, args); | 229 | WriteNewLine(ConsoleColor.Blue, format, args); |
229 | return; | 230 | return; |
230 | } | 231 | } |
232 | |||
233 | [Conditional("DEBUG")] | ||
234 | public void Debug(string format, params object[] args) | ||
235 | { | ||
236 | WriteNewLine(ConsoleColor.Gray, format, args); | ||
237 | return; | ||
238 | } | ||
231 | 239 | ||
240 | [Conditional("DEBUG")] | ||
241 | public void Debug(string sender, string format, params object[] args) | ||
242 | { | ||
243 | WritePrefixLine(DeriveColor(sender), sender); | ||
244 | WriteNewLine(ConsoleColor.Gray, format, args); | ||
245 | return; | ||
246 | } | ||
232 | 247 | ||
233 | private void WriteNewLine(ConsoleColor color, string format, params object[] args) | 248 | private void WriteNewLine(ConsoleColor color, string format, params object[] args) |
234 | { | 249 | { |