From 54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Feb 2009 12:25:39 +0000 Subject: 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. --- OpenSim/Framework/Console/OpenSimAppender.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'OpenSim/Framework/Console/OpenSimAppender.cs') 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 /// public class OpenSimAppender : AnsiColorTerminalAppender { + private ConsoleBase m_console = null; + + public ConsoleBase Console + { + get { return m_console; } + set { m_console = value; } + } + private static readonly ConsoleColor[] Colors = { // the dark colors don't seem to be visible on some black background terminals like putty :( //ConsoleColor.DarkBlue, @@ -55,6 +63,9 @@ namespace OpenSim.Framework.Console override protected void Append(LoggingEvent le) { + if (m_console != null) + m_console.LockOutput(); + try { string loggingMessage = RenderLoggingEvent(le); @@ -96,6 +107,11 @@ namespace OpenSim.Framework.Console { System.Console.WriteLine("Couldn't write out log message: {0}", e.ToString()); } + finally + { + if (m_console != null) + m_console.UnlockOutput(); + } } private void WriteColorText(ConsoleColor color, string sender) -- cgit v1.1