aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Console/OpenSimAppender.cs
diff options
context:
space:
mode:
authorMelanie Thielker2009-02-07 12:25:39 +0000
committerMelanie Thielker2009-02-07 12:25:39 +0000
commit54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a (patch)
treef606cbdbc383ec21fee28f0a1454140a1c714278 /OpenSim/Framework/Console/OpenSimAppender.cs
parentThank you dslake for a patch that: (diff)
downloadopensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.zip
opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.gz
opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.bz2
opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.xz
Replace the console for all OpenSim apps with a new console featuring command
line editing, context sensitive help (press ? at any time), command line history, a new plugin command system and new appender features thet let you type while the console is scrolling. Seamlessly integrates the ICommander interfaces.
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)