* Insert a new 'set log level [level] command on the console'

* The primary immediate use is to provide a means of temporarily reducing log output on the console when executing console commands
* Changing the log level on the console is not permanent and does not affect the log information being put into OpenSim.log
* This could have been done by putting in a threshold level on the Console appeneder in OpenSim.exe.config and implementing config watching in the code.
* But I think that it's a little more user friendly to make this doable via the console.
This commit is contained in:
Justin Clarke Casey
2008-08-16 20:24:08 +00:00
parent 701ee43e46
commit c602d76b79
4 changed files with 87 additions and 7 deletions

View File

@@ -32,17 +32,22 @@ using log4net.Core;
namespace OpenSim.Framework.Console
{
/// <summary>
/// Writes log information out onto the console
/// </summary>
public class OpenSimAppender : AnsiColorTerminalAppender
{
override protected void Append(LoggingEvent le)
{
try {
try
{
string loggingMessage = RenderLoggingEvent(le);
string regex = @"^(?<Front>.*?)\[(?<Category>[^\]]+)\]:?(?<End>.*)";
Regex RE = new Regex(regex, RegexOptions.Multiline);
MatchCollection matches = RE.Matches(loggingMessage);
// Get some direct matches $1 $4 is a
if (matches.Count == 1)
{