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. --- .../Region/Physics/Manager/PhysicsPluginManager.cs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs') diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs index a4ac54f..acaa389b 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs @@ -38,6 +38,8 @@ namespace OpenSim.Region.Physics.Manager /// public class PhysicsPluginManager { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private Dictionary _PhysPlugins = new Dictionary(); private Dictionary _MeshPlugins = new Dictionary(); @@ -60,25 +62,25 @@ namespace OpenSim.Region.Physics.Manager IMesher meshEngine = null; if (_MeshPlugins.ContainsKey(meshEngineName)) { - MainLog.Instance.Verbose("PHYSICS", "creating meshing engine " + meshEngineName); + m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName); meshEngine = _MeshPlugins[meshEngineName].GetMesher(); } else { - MainLog.Instance.Warn("PHYSICS", "couldn't find meshingEngine: {0}", meshEngineName); + m_log.Warn(String.Format("[PHYSICS]: couldn't find meshingEngine: {0}", meshEngineName)); throw new ArgumentException(String.Format("couldn't find meshingEngine: {0}", meshEngineName)); } if (_PhysPlugins.ContainsKey(physEngineName)) { - MainLog.Instance.Verbose("PHYSICS", "creating " + physEngineName); + m_log.Info("[PHYSICS]: creating " + physEngineName); PhysicsScene result = _PhysPlugins[physEngineName].GetScene(); result.Initialise(meshEngine); return result; } else { - MainLog.Instance.Warn("PHYSICS", "couldn't find physicsEngine: {0}", physEngineName); + m_log.Warn(String.Format("[PHYSICS]: couldn't find physicsEngine: {0}", physEngineName)); throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}", physEngineName)); } } @@ -89,7 +91,7 @@ namespace OpenSim.Region.Physics.Manager IMeshingPlugin plugHard; plugHard = new ZeroMesherPlugin(); _MeshPlugins.Add(plugHard.GetName(), plugHard); - MainLog.Instance.Verbose("PHYSICS", "Added meshing engine: " + plugHard.GetName()); + m_log.Info("[PHYSICS]: Added meshing engine: " + plugHard.GetName()); // And now walk all assemblies (DLLs effectively) and see if they are home // of a plugin that is of interest for us @@ -120,7 +122,7 @@ namespace OpenSim.Region.Physics.Manager (IPhysicsPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); plug.Init(); _PhysPlugins.Add(plug.GetName(), plug); - MainLog.Instance.Verbose("PHYSICS", "Added physics engine: " + plug.GetName()); + m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName()); } Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin", true); @@ -130,7 +132,7 @@ namespace OpenSim.Region.Physics.Manager IMeshingPlugin plug = (IMeshingPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); _MeshPlugins.Add(plug.GetName(), plug); - MainLog.Instance.Verbose("PHYSICS", "Added meshing engine: " + plug.GetName()); + m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName()); } physTypeInterface = null; @@ -147,11 +149,11 @@ namespace OpenSim.Region.Physics.Manager { if (isWarning) { - MainLog.Instance.Warn("PHYSICS", message); + m_log.Warn("[PHYSICS]: " + message); } else { - MainLog.Instance.Verbose("PHYSICS", message); + m_log.Info("[PHYSICS]: " + message); } } @@ -171,4 +173,4 @@ namespace OpenSim.Region.Physics.Manager string GetName(); IMesher GetMesher(); } -} \ No newline at end of file +} -- cgit v1.1