Add "get log level" command - this returns the current server session console logging level.
This supersedes getting information by calling "set log level" without a 4th argument, which is confusing.0.7.4-extended
parent
0686a2fba9
commit
4aa725f60b
|
@ -128,8 +128,12 @@ namespace OpenSim.Framework.Servers
|
||||||
"General", false, "show uptime", "show uptime", "Show server uptime", HandleShow);
|
"General", false, "show uptime", "show uptime", "Show server uptime", HandleShow);
|
||||||
|
|
||||||
m_console.Commands.AddCommand(
|
m_console.Commands.AddCommand(
|
||||||
"General", false, "set log level", "set log level <level>", "Set the console logging level",
|
"General", false, "get log level", "get log level", "Get the current console logging level",
|
||||||
HandleLogLevel);
|
(mod, cmd) => ShowLogLevel());
|
||||||
|
|
||||||
|
m_console.Commands.AddCommand(
|
||||||
|
"General", false, "set log level", "set log level <level>",
|
||||||
|
"Set the console logging level for this session.", HandleSetLogLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void HandleShow(string module, string[] cmd)
|
public virtual void HandleShow(string module, string[] cmd)
|
||||||
|
@ -152,16 +156,20 @@ namespace OpenSim.Framework.Servers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleLogLevel(string module, string[] cmd)
|
private void HandleSetLogLevel(string module, string[] cmd)
|
||||||
{
|
{
|
||||||
|
if (cmd.Length != 4)
|
||||||
|
{
|
||||||
|
Notice("Usage: set log level <level>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (null == m_consoleAppender)
|
if (null == m_consoleAppender)
|
||||||
{
|
{
|
||||||
Notice("No appender named Console found (see the log4net config file for this executable)!");
|
Notice("No appender named Console found (see the log4net config file for this executable)!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd.Length > 3)
|
|
||||||
{
|
|
||||||
string rawLevel = cmd[3];
|
string rawLevel = cmd[3];
|
||||||
|
|
||||||
ILoggerRepository repository = LogManager.GetRepository();
|
ILoggerRepository repository = LogManager.GetRepository();
|
||||||
|
@ -174,8 +182,12 @@ namespace OpenSim.Framework.Servers
|
||||||
String.Format(
|
String.Format(
|
||||||
"{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF",
|
"{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF",
|
||||||
rawLevel));
|
rawLevel));
|
||||||
|
|
||||||
|
ShowLogLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ShowLogLevel()
|
||||||
|
{
|
||||||
Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
|
Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue