From 6ed5283bc06a62f38eb517e67b975832b603bf61 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 5 Feb 2008 19:44:27 +0000 Subject: Converted logging to use log4net. Changed LogBase to ConsoleBase, which handles console I/O. This is mostly an in-place conversion, so lots of refactoring can still be done. --- .../LoadRegions/LoadRegionsPlugin.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs') diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 4c1c1d2..3cd918c 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -40,19 +40,21 @@ namespace OpenSim.ApplicationPlugins.LoadRegions [Extension("/OpenSim/Startup")] public class LoadRegionsPlugin : IApplicationPlugin { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + public void Initialise(OpenSimMain openSim) { - MainLog.Instance.Notice("LOADREGIONS", "Load Regions addin being initialised"); + m_log.Info("[LOADREGIONS]: Load Regions addin being initialised"); IRegionLoader regionLoader; if (openSim.ConfigSource.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem") { - MainLog.Instance.Notice("LOADREGIONS", "Loading Region Info from filesystem"); + m_log.Info("[LOADREGIONS]: Loading Region Info from filesystem"); regionLoader = new RegionLoaderFileSystem(); } else { - MainLog.Instance.Notice("LOADREGIONSPLUGIN", "Loading Region Info from web"); + m_log.Info("[LOADREGIONSPLUGIN]: Loading Region Info from web"); regionLoader = new RegionLoaderWebServer(); } @@ -63,7 +65,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions for (int i = 0; i < regionsToLoad.Length; i++) { - MainLog.Instance.Debug("LOADREGIONS", "Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")"); + m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")"); openSim.CreateRegion(regionsToLoad[i]); } @@ -73,17 +75,17 @@ namespace OpenSim.ApplicationPlugins.LoadRegions public void LoadRegionFromConfig(OpenSimMain openSim, ulong regionhandle) { - MainLog.Instance.Notice("LOADREGIONS", "Load Regions addin being initialised"); + m_log.Info("[LOADREGIONS]: Load Regions addin being initialised"); IRegionLoader regionLoader; if (openSim.ConfigSource.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem") { - MainLog.Instance.Notice("LOADREGIONS", "Loading Region Info from filesystem"); + m_log.Info("[LOADREGIONS]: Loading Region Info from filesystem"); regionLoader = new RegionLoaderFileSystem(); } else { - MainLog.Instance.Notice("LOADREGIONS", "Loading Region Info from web"); + m_log.Info("[LOADREGIONS]: Loading Region Info from web"); regionLoader = new RegionLoaderWebServer(); } @@ -93,7 +95,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions { if (regionhandle == regionsToLoad[i].RegionHandle) { - MainLog.Instance.Debug("LOADREGIONS", "Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")"); + m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")"); openSim.CreateRegion(regionsToLoad[i]); } } -- cgit v1.1