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/Scenes/SceneManager.cs | 37 ++++++++++++----------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/SceneManager.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index 1eac61b..7156428 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs @@ -38,6 +38,8 @@ namespace OpenSim.Region.Environment.Scenes public class SceneManager { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + public event RestartSim OnRestartSim; private readonly List m_localScenes; @@ -98,8 +100,7 @@ namespace OpenSim.Region.Environment.Scenes public void HandleRestart(RegionInfo rdata) { - MainLog.Instance.Error("SCENEMANAGER", - "Got Restart message for region:" + rdata.RegionName + " Sending up to main"); + m_log.Error("[SCENEMANAGER]: Got Restart message for region:" + rdata.RegionName + " Sending up to main"); int RegionSceneElement = -1; for (int i = 0; i < m_localScenes.Count; i++) { @@ -146,7 +147,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - MainLog.Instance.Error("REGION", "Unable to notify Other regions of this Region coming up"); + m_log.Error("[REGION]: Unable to notify Other regions of this Region coming up"); } } @@ -285,29 +286,29 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public void SetDebugPacketOnCurrentScene(LogBase log, int newDebug) + public void SetDebugPacketOnCurrentScene(int newDebug) { ForEachCurrentScene(delegate(Scene scene) - { - List EntitieList = scene.GetEntities(); + { + List EntitieList = scene.GetEntities(); - foreach (EntityBase entity in EntitieList) + foreach (EntityBase entity in EntitieList) + { + if (entity is ScenePresence) { - if (entity is ScenePresence) + ScenePresence scenePrescence = entity as ScenePresence; + if (!scenePrescence.IsChildAgent) { - ScenePresence scenePrescence = entity as ScenePresence; - if (!scenePrescence.IsChildAgent) - { - log.Error(String.Format("Packet debug for {0} {1} set to {2}", - scenePrescence.Firstname, - scenePrescence.Lastname, - newDebug)); + m_log.Error(String.Format("Packet debug for {0} {1} set to {2}", + scenePrescence.Firstname, + scenePrescence.Lastname, + newDebug)); - scenePrescence.ControllingClient.SetDebug(newDebug); - } + scenePrescence.ControllingClient.SetDebug(newDebug); } } - }); + } + }); } public List GetCurrentSceneAvatars() -- cgit v1.1