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. --- OpenSim/Region/Environment/ModuleLoader.cs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/Environment/ModuleLoader.cs') diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs index 76ba14b..d4031d9 100644 --- a/OpenSim/Region/Environment/ModuleLoader.cs +++ b/OpenSim/Region/Environment/ModuleLoader.cs @@ -40,16 +40,16 @@ namespace OpenSim.Region.Environment { public class ModuleLoader { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + public Dictionary LoadedAssemblys = new Dictionary(); private readonly List m_loadedModules = new List(); private readonly Dictionary m_loadedSharedModules = new Dictionary(); - private readonly LogBase m_log; private readonly IConfigSource m_config; - public ModuleLoader(LogBase log, IConfigSource config) + public ModuleLoader(IConfigSource config) { - m_log = log; m_config = config; } @@ -78,7 +78,7 @@ namespace OpenSim.Region.Environment DynamicTextureModule dynamicModule = new DynamicTextureModule(); if (m_loadedSharedModules.ContainsKey(dynamicModule.Name)) { - m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule"); + m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule")); } else { @@ -88,7 +88,7 @@ namespace OpenSim.Region.Environment ChatModule chat = new ChatModule(); if (m_loadedSharedModules.ContainsKey(chat.Name)) { - m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", chat.Name, "ChatModule"); + m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", chat.Name, "ChatModule")); } else { @@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment InstantMessageModule imMod = new InstantMessageModule(); if (m_loadedSharedModules.ContainsKey(imMod.Name)) { - m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", imMod.Name, "InstantMessageModule"); + m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", imMod.Name, "InstantMessageModule")); } else { @@ -108,7 +108,7 @@ namespace OpenSim.Region.Environment LoadImageURLModule loadMod = new LoadImageURLModule(); if (m_loadedSharedModules.ContainsKey(loadMod.Name)) { - m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", loadMod.Name, "LoadImageURLModule"); + m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", loadMod.Name, "LoadImageURLModule")); } else { @@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment AvatarFactoryModule avatarFactory = new AvatarFactoryModule(); if (m_loadedSharedModules.ContainsKey(avatarFactory.Name)) { - m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule"); + m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule")); } else { @@ -128,7 +128,7 @@ namespace OpenSim.Region.Environment XMLRPCModule xmlRpcMod = new XMLRPCModule(); if (m_loadedSharedModules.ContainsKey(xmlRpcMod.Name)) { - m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", xmlRpcMod.Name, "XMLRPCModule"); + m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", xmlRpcMod.Name, "XMLRPCModule")); } else { @@ -186,17 +186,17 @@ namespace OpenSim.Region.Environment if (modules.Length > 0) { - m_log.Verbose("MODULES", "Found Module Library [{0}]", dllName); + m_log.Info(String.Format("[MODULES]: Found Module Library [{0}]", dllName)); foreach (IRegionModule module in modules) { if (!module.IsSharedModule) { - m_log.Verbose("MODULES", " [{0}]: Initializing.", module.Name); + m_log.Info(String.Format("[MODULES]: [{0}]: Initializing.", module.Name)); InitializeModule(module, scene); } else { - m_log.Verbose("MODULES", " [{0}]: Loading Shared Module.", module.Name); + m_log.Info(String.Format("[MODULES]: [{0}]: Loading Shared Module.", module.Name)); LoadSharedModule(module); } } @@ -246,7 +246,7 @@ namespace OpenSim.Region.Environment } catch (BadImageFormatException) { - //m_log.Verbose("MODULES", "The file [{0}] is not a module assembly.", e.FileName); + //m_log.Info(String.Format("[MODULES]: The file [{0}] is not a module assembly.", e.FileName)); } } @@ -270,7 +270,7 @@ namespace OpenSim.Region.Environment } catch (ReflectionTypeLoadException) { - m_log.Verbose("MODULES", "Could not load types for [{0}].", pluginAssembly.FullName); + m_log.Info(String.Format("[MODULES]: Could not load types for [{0}].", pluginAssembly.FullName)); } } -- cgit v1.1