From: Alan M Webb <awebb@vnet.ibm.com>

This patch just tightens up console handling in BasOpenSimServer
and removes (or redirects) a couple of messages that were being issued
using Console.Writeline.
0.6.0-stable
Justin Clarke Casey 2008-05-12 13:39:46 +00:00
parent b34d5716a8
commit b4d128c811
3 changed files with 25 additions and 10 deletions

View File

@ -49,8 +49,6 @@ namespace OpenSim.Framework.Console
m_componentName = componentname; m_componentName = componentname;
m_cmdParser = cmdparser; m_cmdParser = cmdparser;
System.Console.WriteLine("Creating new local console");
m_log.Info("[" + m_componentName + "]: Started at " + DateTime.Now.ToString()); m_log.Info("[" + m_componentName + "]: Started at " + DateTime.Now.ToString());
} }

View File

@ -54,7 +54,10 @@ namespace OpenSim.Framework.Servers
/// </summary> /// </summary>
public virtual void Shutdown() public virtual void Shutdown()
{ {
m_console.Close(); if(m_console != null)
{
m_console.Close();
}
Environment.Exit(0); Environment.Exit(0);
} }
@ -68,9 +71,9 @@ namespace OpenSim.Framework.Servers
switch (command) switch (command)
{ {
case "help": case "help":
m_console.Notice("quit - equivalent to shutdown."); Notice("quit - equivalent to shutdown.");
m_console.Notice("show uptime - show server startup and uptime."); Notice("show uptime - show server startup and uptime.");
m_console.Notice("shutdown - shutdown the server.\n"); Notice("shutdown - shutdown the server.\n");
break; break;
case "show": case "show":
@ -96,10 +99,24 @@ namespace OpenSim.Framework.Servers
switch (ShowWhat) switch (ShowWhat)
{ {
case "uptime": case "uptime":
m_console.Notice("Server has been running since " + m_startuptime.ToString()); Notice("Server has been running since " + m_startuptime.DayOfWeek + ", " + m_startuptime.ToString());
m_console.Notice("That is " + (DateTime.Now - m_startuptime).ToString()); Notice("That is an elapsed time of " + (DateTime.Now - m_startuptime).ToString());
break; break;
} }
} }
/// <summary>
/// Console output is only possible if a console has been established.
/// That is something that cannot be determined within this class. So
/// all attempts to use the console MUST be verified.
/// </summary>
private void Notice(string msg)
{
if(m_console != null)
{
m_console.Notice(msg);
}
}
} }
} }

View File

@ -71,7 +71,7 @@ namespace OpenSim.ApplicationPlugins.RegionProxy
public void Initialise(OpenSimMain openSim) public void Initialise(OpenSimMain openSim)
{ {
Console.WriteLine("Starting proxy"); m_log.Info("Starting proxy");
string proxyURL = openSim.ConfigSource.Configs["Network"].GetString("proxy_url", ""); string proxyURL = openSim.ConfigSource.Configs["Network"].GetString("proxy_url", "");
if (proxyURL.Length == 0) return; if (proxyURL.Length == 0) return;