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

@@ -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<uint, IClientAPI> 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)