From b6305011dbaed9fa693823713f3c4446c270f380 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 22 Nov 2012 04:50:09 +0000 Subject: [PATCH] Make "set log level" command available across all servers --- .../Framework/Servers/BaseOpenSimServer.cs | 31 ------------------- OpenSim/Framework/Servers/ServerBase.cs | 31 +++++++++++++++++++ OpenSim/Server/Base/ServicesServerBase.cs | 1 - 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 956017164e..5e898ef74e 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -102,10 +102,6 @@ namespace OpenSim.Framework.Servers "shutdown", "Quit the application", HandleQuit); - m_console.Commands.AddCommand("General", false, "set log level", - "set log level ", - "Set the console logging level", HandleLogLevel); - m_console.Commands.AddCommand("General", false, "show threads", "show threads", "Show thread status", HandleShow); @@ -254,33 +250,6 @@ namespace OpenSim.Framework.Servers Shutdown(); } - private void HandleLogLevel(string module, string[] cmd) - { - if (null == m_consoleAppender) - { - Notice("No appender named Console found (see the log4net config file for this executable)!"); - return; - } - - if (cmd.Length > 3) - { - string rawLevel = cmd[3]; - - ILoggerRepository repository = LogManager.GetRepository(); - Level consoleLevel = repository.LevelMap[rawLevel]; - - if (consoleLevel != null) - m_consoleAppender.Threshold = consoleLevel; - else - Notice( - String.Format( - "{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF", - rawLevel)); - } - - Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold)); - } - /// /// Show help information /// diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 129b5fa44e..feffe6d011 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs @@ -126,6 +126,10 @@ namespace OpenSim.Framework.Servers m_console.Commands.AddCommand( "General", false, "show uptime", "show uptime", "Show server uptime", HandleShow); + + m_console.Commands.AddCommand( + "General", false, "set log level", "set log level ", "Set the console logging level", + HandleLogLevel); } public virtual void HandleShow(string module, string[] cmd) @@ -148,6 +152,33 @@ namespace OpenSim.Framework.Servers } } + private void HandleLogLevel(string module, string[] cmd) + { + if (null == m_consoleAppender) + { + Notice("No appender named Console found (see the log4net config file for this executable)!"); + return; + } + + if (cmd.Length > 3) + { + string rawLevel = cmd[3]; + + ILoggerRepository repository = LogManager.GetRepository(); + Level consoleLevel = repository.LevelMap[rawLevel]; + + if (consoleLevel != null) + m_consoleAppender.Threshold = consoleLevel; + else + Notice( + String.Format( + "{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF", + rawLevel)); + } + + Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold)); + } + /// /// Return a report about the uptime of this server /// diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index 15586f8565..4eed7d5755 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs @@ -285,7 +285,6 @@ namespace OpenSim.Server.Base } } - protected virtual void ReadConfig() { }