* Minor: Make some direct grid server console output into logged messages instead

0.6.0-stable
Justin Clarke Casey 2008-05-12 17:06:37 +00:00
parent dce5c470b6
commit bcf018a98c
1 changed files with 10 additions and 7 deletions

View File

@ -28,7 +28,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection;
using System.Timers; using System.Timers;
using log4net;
using Mono.Addins; using Mono.Addins;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
@ -40,6 +42,8 @@ namespace OpenSim.Grid.GridServer
/// </summary> /// </summary>
public class GridServerBase : BaseOpenSimServer, conscmd_callback public class GridServerBase : BaseOpenSimServer, conscmd_callback
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected GridConfig m_config; protected GridConfig m_config;
protected GridManager m_gridManager; protected GridManager m_gridManager;
protected List<IGridPlugin> m_plugins = new List<IGridPlugin>(); protected List<IGridPlugin> m_plugins = new List<IGridPlugin>();
@ -56,7 +60,7 @@ namespace OpenSim.Grid.GridServer
public GridServerBase() public GridServerBase()
{ {
m_console = new ConsoleBase("OpenGrid", this); m_console = new ConsoleBase("GRID", this);
MainConsole.Instance = m_console; MainConsole.Instance = m_console;
} }
@ -72,13 +76,13 @@ namespace OpenSim.Grid.GridServer
public void Startup() public void Startup()
{ {
m_console.Status("Starting...\n"); m_log.Info("[GRID]: Starting...");
Config(); Config();
SetupGridManager(); SetupGridManager();
m_console.Status("[GRID]: Starting HTTP process"); m_log.Info("[GRID]: Starting HTTP process");
m_httpServer = new BaseHttpServer(m_config.HttpPort); m_httpServer = new BaseHttpServer(m_config.HttpPort);
AddHttpHandlers(); AddHttpHandlers();
@ -87,7 +91,7 @@ namespace OpenSim.Grid.GridServer
m_httpServer.Start(); m_httpServer.Start();
m_console.Status("[GRID]: Starting sim status checker"); m_log.Info("[GRID]: Starting sim status checker");
Timer simCheckTimer = new Timer(3600000 * 3); // 3 Hours between updates. Timer simCheckTimer = new Timer(3600000 * 3); // 3 Hours between updates.
simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims);
@ -114,14 +118,13 @@ namespace OpenSim.Grid.GridServer
protected void LoadGridPlugins() protected void LoadGridPlugins()
{ {
//m_console.Status("[GRIDPLUGINS]: Looking for plugins");
AddinManager.Initialize("."); AddinManager.Initialize(".");
AddinManager.Registry.Update(null); AddinManager.Registry.Update(null);
ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/GridServer"); ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/GridServer");
foreach (TypeExtensionNode node in nodes) foreach (TypeExtensionNode node in nodes)
{ {
m_console.Status("[GRIDPLUGINS]: Loading OpenSim plugin " + node.Path); m_log.Info("[GRID PLUGINS]: Loading OpenSim plugin " + node.Path);
IGridPlugin plugin = (IGridPlugin)node.CreateInstance(); IGridPlugin plugin = (IGridPlugin)node.CreateInstance();
plugin.Initialise(this); plugin.Initialise(this);
m_plugins.Add(plugin); m_plugins.Add(plugin);
@ -130,7 +133,7 @@ namespace OpenSim.Grid.GridServer
protected virtual void SetupGridManager() protected virtual void SetupGridManager()
{ {
m_console.Status("[GRID]: Connecting to Storage Server"); m_log.Info("[DATA]: Connecting to Storage Server");
m_gridManager = new GridManager(); m_gridManager = new GridManager();
m_gridManager.AddPlugin(m_config.DatabaseProvider); m_gridManager.AddPlugin(m_config.DatabaseProvider);
m_gridManager.Config = m_config; m_gridManager.Config = m_config;