From 5ddd8182385585f06c0f784cee27c7aa61b3da54 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 Dec 2013 00:43:10 +0000 Subject: minor: Make wind console commands print out to console rather than log --- .../Region/CoreModules/World/Wind/WindModule.cs | 35 +++++++++++++--------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index 9de588c..dad8bcb 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs @@ -216,13 +216,13 @@ namespace OpenSim.Region.CoreModules // FIXME: If console region is root then this will be printed by every module. Currently, there is no // way to prevent this, short of making the entire module shared (which is complete overkill). // One possibility is to return a bool to signal whether the module has completely handled the command - m_log.InfoFormat("[WIND]: Please change to a specific region in order to set Sun parameters."); + MainConsole.Instance.Output("Please change to a specific region in order to set Sun parameters."); return; } if (m_scene.ConsoleScene() != m_scene) { - m_log.InfoFormat("[WIND]: Console Scene is not my scene."); + MainConsole.Instance.Output("Console Scene is not my scene."); return; } } @@ -233,7 +233,9 @@ namespace OpenSim.Region.CoreModules private void HandleConsoleCommand(string module, string[] cmdparams) { ValidateConsole(); - m_log.Info("[WIND] The wind command can be used to change the currently active wind model plugin and update the parameters for wind plugins."); + + MainConsole.Instance.Output( + "The wind command can be used to change the currently active wind model plugin and update the parameters for wind plugins."); } /// @@ -246,7 +248,9 @@ namespace OpenSim.Region.CoreModules if ((cmdparams.Length != 4) || !cmdparams[1].Equals("base")) { - m_log.Info("[WIND] Invalid parameters to change parameters for Wind module base, usage: wind base "); + MainConsole.Instance.Output( + "Invalid parameters to change parameters for Wind module base, usage: wind base "); + return; } @@ -261,7 +265,9 @@ namespace OpenSim.Region.CoreModules } else { - m_log.InfoFormat("[WIND] Invalid value {0} specified for {1}", cmdparams[3], cmdparams[2]); + MainConsole.Instance.OutputFormat( + "Invalid value {0} specified for {1}", cmdparams[3], cmdparams[2]); + return; } @@ -271,22 +277,23 @@ namespace OpenSim.Region.CoreModules if (desiredPlugin.Equals(m_activeWindPlugin.Name)) { - m_log.InfoFormat("[WIND] Wind model plugin {0} is already active", cmdparams[3]); + MainConsole.Instance.OutputFormat("Wind model plugin {0} is already active", cmdparams[3]); + return; } if (m_availableWindPlugins.ContainsKey(desiredPlugin)) { m_activeWindPlugin = m_availableWindPlugins[cmdparams[3]]; - m_log.InfoFormat("[WIND] {0} wind model plugin now active", m_activeWindPlugin.Name); + + MainConsole.Instance.OutputFormat("{0} wind model plugin now active", m_activeWindPlugin.Name); } else { - m_log.InfoFormat("[WIND] Could not find wind model plugin {0}", desiredPlugin); + MainConsole.Instance.OutputFormat("Could not find wind model plugin {0}", desiredPlugin); } break; } - } /// @@ -300,7 +307,7 @@ namespace OpenSim.Region.CoreModules if ((cmdparams.Length != 4) && (cmdparams.Length != 3)) { - m_log.Info("[WIND] Usage: wind [value]"); + MainConsole.Instance.Output("Usage: wind [value]"); return; } @@ -311,7 +318,7 @@ namespace OpenSim.Region.CoreModules { if (!float.TryParse(cmdparams[3], out value)) { - m_log.InfoFormat("[WIND] Invalid value {0}", cmdparams[3]); + MainConsole.Instance.OutputFormat("Invalid value {0}", cmdparams[3]); } try @@ -320,7 +327,7 @@ namespace OpenSim.Region.CoreModules } catch (Exception e) { - m_log.InfoFormat("[WIND] {0}", e.Message); + MainConsole.Instance.OutputFormat("{0}", e.Message); } } else @@ -328,11 +335,11 @@ namespace OpenSim.Region.CoreModules try { value = WindParamGet(plugin, param); - m_log.InfoFormat("[WIND] {0} : {1}", param, value); + MainConsole.Instance.OutputFormat("{0} : {1}", param, value); } catch (Exception e) { - m_log.InfoFormat("[WIND] {0}", e.Message); + MainConsole.Instance.OutputFormat("{0}", e.Message); } } -- cgit v1.1 From d656ec2a0766cf2a6ff6ad9cd8e2d42ada547d6c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 Dec 2013 01:07:37 +0000 Subject: Make WindParamSet success a console message rather than a log message. This effectively disables the log message as requested by http://opensimulator.org/mantis/view.php?id=6890 --- OpenSim/Region/CoreModules/World/Wind/WindModule.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index dad8bcb..35014f5 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs @@ -324,6 +324,7 @@ namespace OpenSim.Region.CoreModules try { WindParamSet(plugin, param, value); + MainConsole.Instance.OutputFormat("{0} set to {1}", param, value); } catch (Exception e) { @@ -373,13 +374,11 @@ namespace OpenSim.Region.CoreModules { IWindModelPlugin windPlugin = m_availableWindPlugins[plugin]; windPlugin.WindParamSet(param, value); - m_log.InfoFormat("[WIND] {0} set to {1}", param, value); } else { throw new Exception(String.Format("Could not find plugin {0}", plugin)); } - } public float WindParamGet(string plugin, string param) -- cgit v1.1