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:
Jeff Ames
2008-02-05 19:44:27 +00:00
parent 7a61bcff86
commit 6ed5283bc0
173 changed files with 2175 additions and 1950 deletions

View File

@@ -53,6 +53,8 @@ namespace OpenSim.Region.Physics.Meshing
public class Meshmerizer : IMesher
{
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Setting baseDir to a path will enable the dumping of raw files
// raw files can be imported by blender so a visual inspection of the results can be done
// const string baseDir = "rawFiles";
@@ -101,7 +103,6 @@ namespace OpenSim.Region.Physics.Meshing
return influenced;
}
private static void InsertVertices(List<Vertex> vertices, int usedForSeed, List<Triangle> triangles)
{
// This is a variant of the delaunay algorithm
@@ -174,7 +175,6 @@ namespace OpenSim.Region.Physics.Meshing
}
}
private static Mesh CreateBoxMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size)
// Builds the z (+ and -) surfaces of a box shaped prim
{
@@ -236,7 +236,7 @@ namespace OpenSim.Region.Physics.Meshing
// Calculated separately to avoid errors
cutHull.AddVertex(legEnd);
MainLog.Instance.Debug("Starting cutting of the hollow shape from the prim {1}", 0, primName);
m_log.Debug(String.Format("Starting cutting of the hollow shape from the prim {1}", 0, primName));
SimpleHull cuttedHull = SimpleHull.SubtractHull(outerHull, cutHull);
outerHull = cuttedHull;

View File

@@ -42,6 +42,8 @@ namespace OpenSim.Region.Physics.Meshing
// is defined by the hull lies inside or outside the simplex chain
public class SimpleHull
{
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private List<Vertex> vertices = new List<Vertex>();
private List<Vertex> holeVertices = new List<Vertex>(); // Only used, when the hull is hollow
@@ -243,9 +245,9 @@ namespace OpenSim.Region.Physics.Meshing
SimpleHull otherHullClone = otherHull.Clone();
bool intersects = false;
MainLog.Instance.Debug("State before intersection detection");
MainLog.Instance.Debug("The baseHull is:\n{1}", 0, baseHullClone.ToString());
MainLog.Instance.Debug("The otherHull is:\n{1}", 0, otherHullClone.ToString());
m_log.Debug("State before intersection detection");
m_log.Debug(String.Format("The baseHull is:\n{1}", 0, baseHullClone.ToString()));
m_log.Debug(String.Format("The otherHull is:\n{1}", 0, otherHullClone.ToString()));
{
int iBase, iOther;
@@ -274,8 +276,8 @@ namespace OpenSim.Region.Physics.Meshing
}
}
MainLog.Instance.Debug("State after intersection detection for the base hull");
MainLog.Instance.Debug("The baseHull is:\n{1}", 0, baseHullClone.ToString());
m_log.Debug("State after intersection detection for the base hull");
m_log.Debug(String.Format("The baseHull is:\n{1}", 0, baseHullClone.ToString()));
{
int iOther, iBase;
@@ -303,8 +305,8 @@ namespace OpenSim.Region.Physics.Meshing
}
}
MainLog.Instance.Debug("State after intersection detection for the base hull");
MainLog.Instance.Debug("The otherHull is:\n{1}", 0, otherHullClone.ToString());
m_log.Debug("State after intersection detection for the base hull");
m_log.Debug(String.Format("The otherHull is:\n{1}", 0, otherHullClone.ToString()));
bool otherIsInBase = baseHullClone.containsPointsFrom(otherHullClone);
@@ -387,7 +389,7 @@ namespace OpenSim.Region.Physics.Meshing
done = true;
}
MainLog.Instance.Debug("The resulting Hull is:\n{1}", 0, result.ToString());
m_log.Debug(String.Format("The resulting Hull is:\n{1}", 0, result.ToString()));
return result;
}