Fix "set log level" to once again display current log level if it's not given a parameter

This addresses http://opensimulator.org/mantis/view.php?id=5345
0.7.1-dev
Justin Clark-Casey (justincc) 2011-02-04 17:11:35 +00:00
parent c1665cfe9c
commit ba8826d2b8
1 changed files with 15 additions and 12 deletions

View File

@ -319,18 +319,21 @@ namespace OpenSim.Framework.Servers
return; return;
} }
string rawLevel = cmd[3]; if (cmd.Length > 3)
{
ILoggerRepository repository = LogManager.GetRepository(); string rawLevel = cmd[3];
Level consoleLevel = repository.LevelMap[rawLevel];
ILoggerRepository repository = LogManager.GetRepository();
if (consoleLevel != null) Level consoleLevel = repository.LevelMap[rawLevel];
m_consoleAppender.Threshold = consoleLevel;
else if (consoleLevel != null)
Notice( m_consoleAppender.Threshold = consoleLevel;
String.Format( else
"{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF", Notice(
rawLevel)); 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)); Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
} }