mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
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.
This commit is contained in:
@@ -37,6 +37,14 @@ namespace OpenSim.Framework.Console
|
||||
/// </summary>
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user