mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 13:15:44 +08:00
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.
This commit is contained in:
@@ -38,6 +38,8 @@ namespace OpenSim.Region.Physics.Manager
|
||||
/// </summary>
|
||||
public class PhysicsPluginManager
|
||||
{
|
||||
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Dictionary<string, IPhysicsPlugin> _PhysPlugins = new Dictionary<string, IPhysicsPlugin>();
|
||||
private Dictionary<string, IMeshingPlugin> _MeshPlugins = new Dictionary<string, IMeshingPlugin>();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user