From 4065ebff15e228d7227500f3a2275025f5d16966 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 20 May 2009 13:50:33 +0000 Subject: [PATCH] Remove the pre-log4net, discrete output methods from the consoles --- OpenSim/Framework/Console/ConsoleBase.cs | 148 ------------------ .../Framework/Console/ConsolePluginCommand.cs | 2 +- OpenSim/Framework/Console/LocalConsole.cs | 124 --------------- .../Framework/Servers/BaseOpenSimServer.cs | 2 +- .../AssetInventoryServer.cs | 2 +- OpenSim/Grid/AssetServer/Main.cs | 2 +- OpenSim/Grid/GridServer/GridServerBase.cs | 2 +- OpenSim/Grid/InventoryServer/Main.cs | 2 +- OpenSim/Grid/MessagingServer/Main.cs | 6 +- OpenSim/Grid/UserServer/Main.cs | 4 +- OpenSim/Region/Application/OpenSim.cs | 85 +++++----- OpenSim/Region/Application/OpenSimBase.cs | 2 +- OpenSim/Server/Base/HttpServerBase.cs | 4 + OpenSim/Server/Base/ServicesServerBase.cs | 5 + OpenSim/TestSuite/PhysicsBot.cs | 2 +- OpenSim/Tools/pCampBot/BotManager.cs | 2 +- OpenSim/Tools/pCampBot/PhysicsBot.cs | 16 +- 17 files changed, 73 insertions(+), 337 deletions(-) diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index dd3c145ae4..0747ae58c4 100644 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -58,154 +58,6 @@ namespace OpenSim.Framework.Console DefaultPrompt = defaultPrompt; } - /// - /// derive an ansi color from a string, ignoring the darker colors. - /// This is used to help automatically bin component tags with colors - /// in various print functions. - /// - /// arbitrary string for input - /// an ansii color - protected virtual ConsoleColor DeriveColor(string input) - { - return ConsoleColor.White; - } - - /// - /// Sends a warning to the current console output - /// - /// The message to send - /// WriteLine-style message arguments - public void Warn(string format, params object[] args) - { - WriteNewLine(ConsoleColor.Yellow, format, args); - } - - /// - /// Sends a warning to the current console output - /// - /// The module that sent this message - /// The message to send - /// WriteLine-style message arguments - public void Warn(string sender, string format, params object[] args) - { - WriteNewLine(DeriveColor(sender), sender, ConsoleColor.Yellow, format, args); - } - - /// - /// Sends a notice to the current console output - /// - /// The message to send - /// WriteLine-style message arguments - public void Notice(string format, params object[] args) - { - WriteNewLine(ConsoleColor.White, format, args); - } - - /// - /// Sends a notice to the current console output - /// - /// The module that sent this message - /// The message to send - /// WriteLine-style message arguments - public void Notice(string sender, string format, params object[] args) - { - WriteNewLine(DeriveColor(sender), sender, ConsoleColor.White, format, args); - } - /// - /// Sends an error to the current console output - /// - /// The message to send - /// WriteLine-style message arguments - public void Error(string format, params object[] args) - { - WriteNewLine(ConsoleColor.Red, format, args); - } - - /// - /// Sends an error to the current console output - /// - /// The module that sent this message - /// The message to send - /// WriteLine-style message arguments - public void Error(string sender, string format, params object[] args) - { - WriteNewLine(DeriveColor(sender), sender, ConsoleColor.Red, format, args); - } - - /// - /// Sends a status message to the current console output - /// - /// The message to send - /// WriteLine-style message arguments - public void Status(string format, params object[] args) - { - WriteNewLine(ConsoleColor.Blue, format, args); - } - - /// - /// Sends a status message to the current console output - /// - /// The module that sent this message - /// The message to send - /// WriteLine-style message arguments - public void Status(string sender, string format, params object[] args) - { - WriteNewLine(DeriveColor(sender), sender, ConsoleColor.Blue, format, args); - } - - [Conditional("DEBUG")] - public void Debug(string format, params object[] args) - { - WriteNewLine(ConsoleColor.Gray, format, args); - } - - [Conditional("DEBUG")] - public void Debug(string sender, string format, params object[] args) - { - WriteNewLine(DeriveColor(sender), sender, ConsoleColor.Gray, format, args); - } - - protected virtual void WriteNewLine(ConsoleColor senderColor, string sender, ConsoleColor color, string format, params object[] args) - { - WritePrefixLine(senderColor, sender); - WriteConsoleLine(color, format, args); - } - - protected virtual void WriteNewLine(ConsoleColor color, string format, params object[] args) - { - WriteConsoleLine(color, format, args); - } - - protected virtual void WriteConsoleLine(ConsoleColor color, string format, params object[] args) - { - try - { - System.Console.WriteLine(format, args); - } - catch (ObjectDisposedException) - { - } - } - - protected virtual void WritePrefixLine(ConsoleColor color, string sender) - { - try - { - sender = sender.ToUpper(); - - System.Console.WriteLine("[" + sender + "] "); - - System.Console.Write("["); - - System.Console.Write(sender); - - System.Console.Write("] \t"); - } - catch (ObjectDisposedException) - { - } - } - public virtual void LockOutput() { } diff --git a/OpenSim/Framework/Console/ConsolePluginCommand.cs b/OpenSim/Framework/Console/ConsolePluginCommand.cs index bf70645ba6..8b87239246 100644 --- a/OpenSim/Framework/Console/ConsolePluginCommand.cs +++ b/OpenSim/Framework/Console/ConsolePluginCommand.cs @@ -124,7 +124,7 @@ namespace OpenSim.Framework.Console /// public void ShowHelp(ConsoleBase console) { - console.Notice(String.Join(" ", m_cmdText) + " - " + m_helpText); + console.Output(String.Join(" ", m_cmdText) + " - " + m_helpText); } /// diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index 22f10fc3ba..ca57bd60b8 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -62,19 +62,6 @@ namespace OpenSim.Framework.Console history.Add(text); } - /// - /// derive an ansi color from a string, ignoring the darker colors. - /// This is used to help automatically bin component tags with colors - /// in various print functions. - /// - /// arbitrary string for input - /// an ansii color - protected override ConsoleColor DeriveColor(string input) - { - int colIdx = (input.ToUpper().GetHashCode() % 6) + 9; - return (ConsoleColor) colIdx; - } - private int SetCursorTop(int top) { if (top >= 0 && top < System.Console.BufferHeight) @@ -101,117 +88,6 @@ namespace OpenSim.Framework.Console } } - protected override void WriteNewLine(ConsoleColor senderColor, string sender, ConsoleColor color, string format, params object[] args) - { - lock (cmdline) - { - if (y != -1) - { - y=SetCursorTop(y); - System.Console.CursorLeft = 0; - - int count = cmdline.Length; - - System.Console.Write(" "); - while (count-- > 0) - System.Console.Write(" "); - - y=SetCursorTop(y); - System.Console.CursorLeft = 0; - } - WritePrefixLine(senderColor, sender); - WriteConsoleLine(color, format, args); - if (y != -1) - y = System.Console.CursorTop; - } - } - - protected override void WriteNewLine(ConsoleColor color, string format, params object[] args) - { - lock (cmdline) - { - if (y != -1) - { - y=SetCursorTop(y); - System.Console.CursorLeft = 0; - - int count = cmdline.Length; - - System.Console.Write(" "); - while (count-- > 0) - System.Console.Write(" "); - - y=SetCursorTop(y); - System.Console.CursorLeft = 0; - } - WriteConsoleLine(color, format, args); - if (y != -1) - y = System.Console.CursorTop; - } - } - - protected override void WriteConsoleLine(ConsoleColor color, string format, params object[] args) - { - try - { - lock (m_syncRoot) - { - try - { - if (color != ConsoleColor.White) - System.Console.ForegroundColor = color; - - System.Console.WriteLine(format, args); - System.Console.ResetColor(); - } - catch (ArgumentNullException) - { - // Some older systems dont support coloured text. - System.Console.WriteLine(format, args); - } - catch (FormatException) - { - System.Console.WriteLine(args); - } - } - } - catch (ObjectDisposedException) - { - } - } - - protected override void WritePrefixLine(ConsoleColor color, string sender) - { - try - { - lock (m_syncRoot) - { - sender = sender.ToUpper(); - - System.Console.WriteLine("[" + sender + "] "); - - System.Console.Write("["); - - try - { - System.Console.ForegroundColor = color; - System.Console.Write(sender); - System.Console.ResetColor(); - } - catch (ArgumentNullException) - { - // Some older systems dont support coloured text. - System.Console.WriteLine(sender); - } - - System.Console.Write("] \t"); - } - } - catch (ObjectDisposedException) - { - } - } - private void Show() { lock (cmdline) diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index d8a22b106e..be769bfb84 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -411,7 +411,7 @@ namespace OpenSim.Framework.Servers { if (m_console != null) { - m_console.Notice(msg); + m_console.Output(msg); } } diff --git a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs index 0b5882562b..16b9d9e012 100644 --- a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs +++ b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs @@ -119,7 +119,7 @@ namespace OpenSim.Grid.AssetInventoryServer public void Work() { - m_console.Notice("Enter help for a list of commands"); + m_console.Output("Enter help for a list of commands"); while (true) { diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index 4a4910d8fc..e309273716 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs @@ -67,7 +67,7 @@ namespace OpenSim.Grid.AssetServer private void Work() { - m_console.Notice("Enter help for a list of commands"); + m_console.Output("Enter help for a list of commands"); while (true) { diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs index 67bef2e221..6f47304cda 100644 --- a/OpenSim/Grid/GridServer/GridServerBase.cs +++ b/OpenSim/Grid/GridServer/GridServerBase.cs @@ -61,7 +61,7 @@ namespace OpenSim.Grid.GridServer public void Work() { - m_console.Notice("Enter help for a list of commands\n"); + m_console.Output("Enter help for a list of commands\n"); while (true) { diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index 7891965fa4..75603831b5 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs @@ -164,7 +164,7 @@ namespace OpenSim.Grid.InventoryServer private void Work() { - m_console.Notice("Enter help for a list of commands\n"); + m_console.Output("Enter help for a list of commands\n"); while (true) { diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index 2b809f9b77..7e4a2cbfc7 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs @@ -76,7 +76,7 @@ namespace OpenSim.Grid.MessagingServer private void Work() { - m_console.Notice("Enter help for a list of commands\n"); + m_console.Output("Enter help for a list of commands\n"); while (true) { @@ -120,7 +120,7 @@ namespace OpenSim.Grid.MessagingServer m_httpServer.Stop(); m_httpServer = null; } - m_console.Notice("[SERVER]: Deregistered from userserver."); + m_console.Output("[SERVER]: Deregistered from userserver."); } protected override void StartupSpecific() @@ -192,7 +192,7 @@ namespace OpenSim.Grid.MessagingServer private void HandleClearCache(string module, string[] cmd) { int entries = m_regionModule.ClearRegionCache(); - m_console.Notice("Region cache cleared! Cleared " + + m_console.Output("Region cache cleared! Cleared " + entries.ToString() + " entries"); } diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index b1f17875aa..7bb8b12ea1 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -91,7 +91,7 @@ namespace OpenSim.Grid.UserServer public void Work() { - m_console.Notice("Enter help for a list of commands\n"); + m_console.Output("Enter help for a list of commands\n"); while (true) { @@ -280,7 +280,7 @@ namespace OpenSim.Grid.UserServer public void TestResponse(List resp) { - m_console.Notice("response got"); + m_console.Output("response got"); } } } diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 282963c571..6c1fee5112 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -357,7 +357,7 @@ namespace OpenSim if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) { - m_console.Notice( + m_log.Info( String.Format( "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}", presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName)); @@ -372,7 +372,7 @@ namespace OpenSim presence.Scene.IncomingCloseAgent(presence.UUID); } } - m_console.Notice(""); + m_log.Info(""); } /// @@ -418,7 +418,7 @@ namespace OpenSim private void HandleForceUpdate(string module, string[] args) { - m_console.Notice("Updating all clients"); + m_log.Info("Updating all clients"); m_sceneManager.ForceCurrentSceneClientUpdate(); } @@ -430,7 +430,7 @@ namespace OpenSim } else { - m_console.Notice("Argument error: edit scale "); + m_log.Info("Argument error: edit scale "); } } @@ -438,7 +438,7 @@ namespace OpenSim { if (cmd.Length < 4 || !cmd[3].EndsWith(".xml")) { - m_console.Error("Usage: create region "); + m_log.Error("Usage: create region "); return; } @@ -485,8 +485,8 @@ namespace OpenSim case "set": if (cmdparams.Length < 4) { - m_console.Error(n, "SYNTAX: " + n + " SET SECTION KEY VALUE"); - m_console.Error(n, "EXAMPLE: " + n + " SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5"); + m_log.Error("SYNTAX: " + n + " SET SECTION KEY VALUE"); + m_log.Error("EXAMPLE: " + n + " SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5"); } else { @@ -502,7 +502,7 @@ namespace OpenSim c.Set(cmdparams[2], _value); m_config.Source.Merge(source); - m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " + + m_log.Error(n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " + _value); } } @@ -511,20 +511,20 @@ namespace OpenSim case "get": if (cmdparams.Length < 3) { - m_console.Error(n, "SYNTAX: " + n + " GET SECTION KEY"); - m_console.Error(n, "EXAMPLE: " + n + " GET ScriptEngine.DotNetEngine NumberOfScriptThreads"); + m_log.Error("SYNTAX: " + n + " GET SECTION KEY"); + m_log.Error("EXAMPLE: " + n + " GET ScriptEngine.DotNetEngine NumberOfScriptThreads"); } else { IConfig c = m_config.Source.Configs[cmdparams[1]]; // DefaultConfig().Configs[cmdparams[1]]; if (c == null) { - m_console.Notice(n, "Section \"" + cmdparams[1] + "\" does not exist."); + m_log.Info("Section \"" + cmdparams[1] + "\" does not exist."); break; } else { - m_console.Notice(n + " GET " + cmdparams[1] + " " + cmdparams[2] + ": " + + m_log.Info(n + " GET " + cmdparams[1] + " " + cmdparams[2] + ": " + c.GetString(cmdparams[2])); } } @@ -532,7 +532,7 @@ namespace OpenSim break; case "save": - m_console.Notice("Saving configuration file: " + Application.iniFilePath); + m_log.Info("Saving configuration file: " + Application.iniFilePath); m_config.Save(Application.iniFilePath); break; } @@ -552,7 +552,7 @@ namespace OpenSim case "list": foreach (IRegionModule irm in m_moduleLoader.GetLoadedSharedModules) { - m_console.Notice("Shared region module: " + irm.Name); + m_log.Info("Shared region module: " + irm.Name); } break; case "unload": @@ -562,7 +562,7 @@ namespace OpenSim { if (rm.Name.ToLower() == cmdparams[1].ToLower()) { - m_console.Notice("Unloading module: " + rm.Name); + m_log.Info("Unloading module: " + rm.Name); m_moduleLoader.UnloadModule(rm); } } @@ -573,7 +573,7 @@ namespace OpenSim { foreach (Scene s in new ArrayList(m_sceneManager.Scenes)) { - m_console.Notice("Loading module: " + cmdparams[1]); + m_log.Info("Loading module: " + cmdparams[1]); m_moduleLoader.LoadRegionModules(cmdparams[1], s); } } @@ -618,7 +618,7 @@ namespace OpenSim if (m_sceneManager.TryGetScene(regRemoveName, out removeScene)) RemoveRegion(removeScene, false); else - m_console.Error("no region with that name"); + m_log.Error("no region with that name"); break; case "delete-region": @@ -628,7 +628,7 @@ namespace OpenSim if (m_sceneManager.TryGetScene(regDeleteName, out killScene)) RemoveRegion(killScene, true); else - m_console.Error("no region with that name"); + m_log.Error("no region with that name"); break; case "restart": @@ -672,15 +672,15 @@ namespace OpenSim string newRegionName = CombineParams(cmdparams, 2); if (!m_sceneManager.TrySetCurrentScene(newRegionName)) - m_console.Error("Couldn't select region " + newRegionName); + m_log.Error("Couldn't select region " + newRegionName); } else { - m_console.Error("Usage: change region "); + m_log.Error("Usage: change region "); } string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); - m_console.Notice(String.Format("Currently selected region is {0}", regionName)); + m_log.Info(String.Format("Currently selected region is {0}", regionName)); m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); m_console.ConsoleScene = m_sceneManager.CurrentScene; } @@ -697,7 +697,7 @@ namespace OpenSim } else { - m_console.Notice("Create user is not available in grid mode, use the user server."); + m_log.Info("Create user is not available in grid mode, use the user server."); } } @@ -713,7 +713,7 @@ namespace OpenSim } else { - m_console.Notice("Reset user password is not available in grid mode, use the user-server."); + m_log.Info("Reset user password is not available in grid mode, use the user-server."); } } @@ -738,9 +738,9 @@ namespace OpenSim } else { - m_console.Error("packet debug should be 0..255"); + m_log.Error("packet debug should be 0..255"); } - m_console.Notice("New packet debug: " + newDebug.ToString()); + m_log.Info("New packet debug: " + newDebug.ToString()); } break; @@ -750,7 +750,7 @@ namespace OpenSim { if (m_sceneManager.CurrentScene == null) { - m_console.Notice("Please use 'change region ' first"); + m_log.Info("Please use 'change region ' first"); } else { @@ -759,8 +759,7 @@ namespace OpenSim bool physicsOn = !Convert.ToBoolean(args[4]); m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); - m_console.Notice( - "CONSOLE", + m_log.Info( String.Format( "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", !scriptingOn, !collisionsOn, !physicsOn)); @@ -768,13 +767,13 @@ namespace OpenSim } else { - m_console.Error("debug scene (where inside <> is true/false)"); + m_log.Error("debug scene (where inside <> is true/false)"); } break; default: - m_console.Error("Unknown debug"); + m_log.Error("Unknown debug"); break; } } @@ -805,9 +804,9 @@ namespace OpenSim agents = m_sceneManager.GetCurrentSceneAvatars(); } - m_console.Notice(String.Format("\nAgents connected: {0}\n", agents.Count)); + m_log.Info(String.Format("\nAgents connected: {0}\n", agents.Count)); - m_console.Notice( + m_log.Info( String.Format("{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}", "Firstname", "Lastname", "Agent ID", "Root/Child", "Region")); @@ -825,7 +824,7 @@ namespace OpenSim regionName = regionInfo.RegionName; } - m_console.Notice( + m_log.Info( String.Format( "{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}", presence.Firstname, @@ -835,14 +834,14 @@ namespace OpenSim regionName)); } - m_console.Notice(""); + m_log.Info(""); break; case "modules": - m_console.Notice("The currently loaded shared modules are:"); + m_log.Info("The currently loaded shared modules are:"); foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) { - m_console.Notice("Shared Module: " + module.Name); + m_log.Info("Shared Module: " + module.Name); } break; @@ -850,7 +849,7 @@ namespace OpenSim m_sceneManager.ForEachScene( delegate(Scene scene) { - m_console.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " + + m_log.Info("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " + scene.RegionInfo.RegionLocX + " , Region YLoc: " + scene.RegionInfo.RegionLocY + " , Region Port: " + scene.RegionInfo.InternalEndPoint.Port.ToString()); @@ -878,7 +877,7 @@ namespace OpenSim { rating = "PG"; } - m_console.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region Rating: " + + m_log.Info("Region Name: " + scene.RegionInfo.RegionName + " , Region Rating: " + rating); }); break; @@ -1044,7 +1043,7 @@ namespace OpenSim { loadOffset.Z = (float) Convert.ToDecimal(cmdparams[6]); } - m_console.Error("loadOffsets = <" + loadOffset.X + "," + loadOffset.Y + "," + + m_log.Error("loadOffsets = <" + loadOffset.X + "," + loadOffset.Y + "," + loadOffset.Z + ">"); } } @@ -1058,7 +1057,7 @@ namespace OpenSim } catch (FileNotFoundException) { - m_console.Error("Default xml not found. Usage: load-xml "); + m_log.Error("Default xml not found. Usage: load-xml "); } } } @@ -1085,7 +1084,7 @@ namespace OpenSim } catch (FileNotFoundException) { - m_console.Error("Specified xml not found. Usage: load xml2 "); + m_log.Error("Specified xml not found. Usage: load xml2 "); } } else @@ -1096,7 +1095,7 @@ namespace OpenSim } catch (FileNotFoundException) { - m_console.Error("Default xml not found. Usage: load xml2 "); + m_log.Error("Default xml not found. Usage: load xml2 "); } } } @@ -1120,7 +1119,7 @@ namespace OpenSim } catch (Exception e) { - m_console.Error(e.Message); + m_log.Error(e.Message); } } diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index eaf6e4f0bc..3ea636abda 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -273,7 +273,7 @@ namespace OpenSim // ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1]); if (moduleCommander != null) - m_console.Notice(moduleCommander.Help); + m_console.Output(moduleCommander.Help); } protected override void Initialize() diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs index dc12cf93b6..6b5c259eef 100644 --- a/OpenSim/Server/Base/HttpServerBase.cs +++ b/OpenSim/Server/Base/HttpServerBase.cs @@ -76,6 +76,10 @@ namespace OpenSim.Server.Base } m_HttpServer = new BaseHttpServer(port); + if (MainConsole.Instance is RemoteConsole) + { + ((RemoteConsole)MainConsole.Instance).SetServer(m_HttpServer); + } } protected override void Initialise() diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index 5350bce56a..0de6c4a27f 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs @@ -145,6 +145,11 @@ namespace OpenSim.Server.Base { MainConsole.Instance = new CommandConsole(prompt); } + else if (consoleType == "rest") + { + MainConsole.Instance = new RemoteConsole(prompt); + ((RemoteConsole)MainConsole.Instance).ReadConfig(Config); + } else { MainConsole.Instance = new LocalConsole(prompt); diff --git a/OpenSim/TestSuite/PhysicsBot.cs b/OpenSim/TestSuite/PhysicsBot.cs index fd20a1eb75..68c1c8a0d8 100644 --- a/OpenSim/TestSuite/PhysicsBot.cs +++ b/OpenSim/TestSuite/PhysicsBot.cs @@ -147,7 +147,7 @@ namespace OpenSim.TestSuite } else { - MainConsole.Instance.Error(firstname + " " + lastname, "Can't login: " + client.Network.LoginMessage); + MainConsole.Instance.Output(firstname + " " + lastname + "Can't login: " + client.Network.LoginMessage); if (OnDisconnected != null) { OnDisconnected(this, EventType.DISCONNECTED); diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 2cd947ee9a..93240d5d4f 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs @@ -213,7 +213,7 @@ namespace pCampBot private void HandleShutdown(string module, string[] cmd) { - m_console.Warn("BOTMANAGER", "Shutting down bots"); + m_log.Warn("[BOTMANAGER]: Shutting down bots"); doBotShutdown(); } diff --git a/OpenSim/Tools/pCampBot/PhysicsBot.cs b/OpenSim/Tools/pCampBot/PhysicsBot.cs index b84993e054..282f4a07ed 100644 --- a/OpenSim/Tools/pCampBot/PhysicsBot.cs +++ b/OpenSim/Tools/pCampBot/PhysicsBot.cs @@ -180,7 +180,7 @@ namespace pCampBot } else { - MainConsole.Instance.Error(firstname + " " + lastname, "Can't login: " + client.Network.LoginMessage); + MainConsole.Instance.Output(firstname + " " + lastname + " Can't login: " + client.Network.LoginMessage); if (OnDisconnected != null) { OnDisconnected(this, EventType.DISCONNECTED); @@ -222,12 +222,12 @@ namespace pCampBot } else { - MainConsole.Instance.Error(String.Format("Failed to decode {0} asset {1}", asset.AssetType, asset.AssetID)); + MainConsole.Instance.Output(String.Format("Failed to decode {0} asset {1}", asset.AssetType, asset.AssetID)); } } catch (Exception e) { - MainConsole.Instance.Error(String.Format("Exception: {0}",e.ToString())); + MainConsole.Instance.Output(String.Format("Exception: {0}",e.ToString())); } } } @@ -261,7 +261,7 @@ namespace pCampBot if (wear == "yes") { //TODO: Implement random outfit picking - MainConsole.Instance.Notice("Picks a random outfit. Not yet implemented."); + MainConsole.Instance.Output("Picks a random outfit. Not yet implemented."); } else if (wear != "save") saveDir = "MyAppearance/" + wear; @@ -290,7 +290,7 @@ namespace pCampBot listwearables.Add(item); } else - MainConsole.Instance.Error(String.Format("Failed to create item {0}",item.Name)); + MainConsole.Instance.Output(String.Format("Failed to create item {0}",item.Name)); } ); } @@ -312,7 +312,7 @@ namespace pCampBot listwearables.Add(item); } else - MainConsole.Instance.Error(String.Format("Failed to create item {0}",item.Name)); + MainConsole.Instance.Output(String.Format("Failed to create item {0}",item.Name)); } ); } @@ -320,10 +320,10 @@ namespace pCampBot Thread.Sleep(1000); if (listwearables == null || listwearables.Count == 0) - MainConsole.Instance.Notice("Nothing to send on this folder!"); + MainConsole.Instance.Output("Nothing to send on this folder!"); else { - MainConsole.Instance.Notice(String.Format("Sending {0} wearables...",listwearables.Count)); + MainConsole.Instance.Output(String.Format("Sending {0} wearables...",listwearables.Count)); client.Appearance.WearOutfit(listwearables, false); } }