aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Console/OpenSimAppender.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Console/OpenSimAppender.cs')
-rw-r--r--OpenSim/Framework/Console/OpenSimAppender.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Framework/Console/OpenSimAppender.cs b/OpenSim/Framework/Console/OpenSimAppender.cs
index b07617f..6193bac 100644
--- a/OpenSim/Framework/Console/OpenSimAppender.cs
+++ b/OpenSim/Framework/Console/OpenSimAppender.cs
@@ -37,6 +37,14 @@ namespace OpenSim.Framework.Console
37 /// </summary> 37 /// </summary>
38 public class OpenSimAppender : AnsiColorTerminalAppender 38 public class OpenSimAppender : AnsiColorTerminalAppender
39 { 39 {
40 private ConsoleBase m_console = null;
41
42 public ConsoleBase Console
43 {
44 get { return m_console; }
45 set { m_console = value; }
46 }
47
40 private static readonly ConsoleColor[] Colors = { 48 private static readonly ConsoleColor[] Colors = {
41 // the dark colors don't seem to be visible on some black background terminals like putty :( 49 // the dark colors don't seem to be visible on some black background terminals like putty :(
42 //ConsoleColor.DarkBlue, 50 //ConsoleColor.DarkBlue,
@@ -55,6 +63,9 @@ namespace OpenSim.Framework.Console
55 63
56 override protected void Append(LoggingEvent le) 64 override protected void Append(LoggingEvent le)
57 { 65 {
66 if (m_console != null)
67 m_console.LockOutput();
68
58 try 69 try
59 { 70 {
60 string loggingMessage = RenderLoggingEvent(le); 71 string loggingMessage = RenderLoggingEvent(le);
@@ -96,6 +107,11 @@ namespace OpenSim.Framework.Console
96 { 107 {
97 System.Console.WriteLine("Couldn't write out log message: {0}", e.ToString()); 108 System.Console.WriteLine("Couldn't write out log message: {0}", e.ToString());
98 } 109 }
110 finally
111 {
112 if (m_console != null)
113 m_console.UnlockOutput();
114 }
99 } 115 }
100 116
101 private void WriteColorText(ConsoleColor color, string sender) 117 private void WriteColorText(ConsoleColor color, string sender)