aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r--OpenSim/Framework/Servers/ServerBase.cs50
1 files changed, 31 insertions, 19 deletions
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs
index feffe6d..9973a2d 100644
--- a/OpenSim/Framework/Servers/ServerBase.cs
+++ b/OpenSim/Framework/Servers/ServerBase.cs
@@ -128,8 +128,12 @@ namespace OpenSim.Framework.Servers
128 "General", false, "show uptime", "show uptime", "Show server uptime", HandleShow); 128 "General", false, "show uptime", "show uptime", "Show server uptime", HandleShow);
129 129
130 m_console.Commands.AddCommand( 130 m_console.Commands.AddCommand(
131 "General", false, "set log level", "set log level <level>", "Set the console logging level", 131 "General", false, "get log level", "get log level", "Get the current console logging level",
132 HandleLogLevel); 132 (mod, cmd) => ShowLogLevel());
133
134 m_console.Commands.AddCommand(
135 "General", false, "set log level", "set log level <level>",
136 "Set the console logging level for this session.", HandleSetLogLevel);
133 } 137 }
134 138
135 public virtual void HandleShow(string module, string[] cmd) 139 public virtual void HandleShow(string module, string[] cmd)
@@ -152,30 +156,38 @@ namespace OpenSim.Framework.Servers
152 } 156 }
153 } 157 }
154 158
155 private void HandleLogLevel(string module, string[] cmd) 159 private void HandleSetLogLevel(string module, string[] cmd)
156 { 160 {
157 if (null == m_consoleAppender) 161 if (cmd.Length != 4)
158 { 162 {
159 Notice("No appender named Console found (see the log4net config file for this executable)!"); 163 Notice("Usage: set log level <level>");
160 return; 164 return;
161 } 165 }
162 166
163 if (cmd.Length > 3) 167 if (null == m_consoleAppender)
164 { 168 {
165 string rawLevel = cmd[3]; 169 Notice("No appender named Console found (see the log4net config file for this executable)!");
166 170 return;
167 ILoggerRepository repository = LogManager.GetRepository();
168 Level consoleLevel = repository.LevelMap[rawLevel];
169
170 if (consoleLevel != null)
171 m_consoleAppender.Threshold = consoleLevel;
172 else
173 Notice(
174 String.Format(
175 "{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF",
176 rawLevel));
177 } 171 }
178 172
173 string rawLevel = cmd[3];
174
175 ILoggerRepository repository = LogManager.GetRepository();
176 Level consoleLevel = repository.LevelMap[rawLevel];
177
178 if (consoleLevel != null)
179 m_consoleAppender.Threshold = consoleLevel;
180 else
181 Notice(
182 String.Format(
183 "{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF",
184 rawLevel));
185
186 ShowLogLevel();
187 }
188
189 private void ShowLogLevel()
190 {
179 Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold)); 191 Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
180 } 192 }
181 193