diff options
author | Justin Clarke Casey | 2008-08-16 20:24:08 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-08-16 20:24:08 +0000 |
commit | c602d76b79f09c745ae4e7a1a7ab6a2d6f2c3bff (patch) | |
tree | c890bca7c2bc8050b0eedd8a8f339c4af25abf1a /OpenSim/Framework/Console/OpenSimAppender.cs | |
parent | Mantis#1960. Thank you kindly, Tyre for a patch that: (diff) | |
download | opensim-SC-c602d76b79f09c745ae4e7a1a7ab6a2d6f2c3bff.zip opensim-SC-c602d76b79f09c745ae4e7a1a7ab6a2d6f2c3bff.tar.gz opensim-SC-c602d76b79f09c745ae4e7a1a7ab6a2d6f2c3bff.tar.bz2 opensim-SC-c602d76b79f09c745ae4e7a1a7ab6a2d6f2c3bff.tar.xz |
* 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.
Diffstat (limited to 'OpenSim/Framework/Console/OpenSimAppender.cs')
-rw-r--r-- | OpenSim/Framework/Console/OpenSimAppender.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/OpenSim/Framework/Console/OpenSimAppender.cs b/OpenSim/Framework/Console/OpenSimAppender.cs index ddd6d9a..2527977 100644 --- a/OpenSim/Framework/Console/OpenSimAppender.cs +++ b/OpenSim/Framework/Console/OpenSimAppender.cs | |||
@@ -32,17 +32,22 @@ using log4net.Core; | |||
32 | 32 | ||
33 | namespace OpenSim.Framework.Console | 33 | namespace OpenSim.Framework.Console |
34 | { | 34 | { |
35 | /// <summary> | ||
36 | /// Writes log information out onto the console | ||
37 | /// </summary> | ||
35 | public class OpenSimAppender : AnsiColorTerminalAppender | 38 | public class OpenSimAppender : AnsiColorTerminalAppender |
36 | { | 39 | { |
37 | override protected void Append(LoggingEvent le) | 40 | override protected void Append(LoggingEvent le) |
38 | { | 41 | { |
39 | try { | 42 | try |
43 | { | ||
40 | string loggingMessage = RenderLoggingEvent(le); | 44 | string loggingMessage = RenderLoggingEvent(le); |
41 | 45 | ||
42 | string regex = @"^(?<Front>.*?)\[(?<Category>[^\]]+)\]:?(?<End>.*)"; | 46 | string regex = @"^(?<Front>.*?)\[(?<Category>[^\]]+)\]:?(?<End>.*)"; |
43 | 47 | ||
44 | Regex RE = new Regex(regex, RegexOptions.Multiline); | 48 | Regex RE = new Regex(regex, RegexOptions.Multiline); |
45 | MatchCollection matches = RE.Matches(loggingMessage); | 49 | MatchCollection matches = RE.Matches(loggingMessage); |
50 | |||
46 | // Get some direct matches $1 $4 is a | 51 | // Get some direct matches $1 $4 is a |
47 | if (matches.Count == 1) | 52 | if (matches.Count == 1) |
48 | { | 53 | { |