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.
This commit is contained in:
MW
2007-08-31 12:19:36 +00:00
parent a37275fe40
commit f388a47254
9 changed files with 153 additions and 9 deletions

View File

@@ -28,6 +28,7 @@
using System;
using System.IO;
using System.Net;
using System.Diagnostics;
using System.Collections.Generic;
namespace OpenSim.Framework.Console
@@ -228,7 +229,21 @@ namespace OpenSim.Framework.Console
WriteNewLine(ConsoleColor.Blue, format, args);
return;
}
[Conditional("DEBUG")]
public void Debug(string format, params object[] args)
{
WriteNewLine(ConsoleColor.Gray, format, args);
return;
}
[Conditional("DEBUG")]
public void Debug(string sender, string format, params object[] args)
{
WritePrefixLine(DeriveColor(sender), sender);
WriteNewLine(ConsoleColor.Gray, format, args);
return;
}
private void WriteNewLine(ConsoleColor color, string format, params object[] args)
{