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/Framework/ClientManager.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'OpenSim/Framework/ClientManager.cs') diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs index de7708c..8422c17 100644 --- a/OpenSim/Framework/ClientManager.cs +++ b/OpenSim/Framework/ClientManager.cs @@ -36,11 +36,12 @@ namespace OpenSim.Framework public class ClientManager { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private Dictionary m_clients; public void ForEachClient(ForEachClientDelegate whatToDo) { - // Wasteful, I know IClientAPI[] LocalClients = new IClientAPI[0]; lock (m_clients) @@ -57,7 +58,7 @@ namespace OpenSim.Framework } catch (System.Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Warn("CLIENT", "Unable to do ForEachClient for one of the clients" + "\n Reason: " + e.ToString()); + m_log.Warn("[CLIENT]: Unable to do ForEachClient for one of the clients" + "\n Reason: " + e.ToString()); } } } @@ -116,11 +117,9 @@ namespace OpenSim.Framework } catch (System.Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Error("CLIENT", string.Format("Unable to shutdown circuit for: {0}\n Reason: {1}", agentId, e)); + m_log.Error(string.Format("[CLIENT]: Unable to shutdown circuit for: {0}\n Reason: {1}", agentId, e)); } } - - } private uint[] GetAllCircuits(LLUUID agentId) @@ -134,7 +133,6 @@ namespace OpenSim.Framework m_clients.Values.CopyTo(LocalClients, 0); } - for (int i = 0; i < LocalClients.Length; i++ ) { if (LocalClients[i].AgentId == agentId) @@ -160,7 +158,6 @@ namespace OpenSim.Framework m_clients.Values.CopyTo(LocalClients, 0); } - for (int i = 0; i < LocalClients.Length; i++) { if (LocalClients[i].AgentId != sender.AgentId) -- cgit v1.1