mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
* Replaced old logging mechanism with new shiny logging mechanism
* Console, I bid thee farewall. Use "Log" now where console used to exist.
This commit is contained in:
@@ -245,7 +245,7 @@ namespace OpenSim
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString());
|
||||
OpenSim.Framework.Console.MainLog.Instance.Warn("ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace OpenSim
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString());
|
||||
OpenSim.Framework.Console.MainLog.Instance.Warn("ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace OpenSim
|
||||
|
||||
protected virtual bool Logout(ClientView simClient, Packet packet)
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:ProcessInPacket() - Got a logout request");
|
||||
OpenSim.Framework.Console.MainLog.Instance.Verbose( "OpenSimClient.cs:ProcessInPacket() - Got a logout request");
|
||||
//send reply to let the client logout
|
||||
LogoutReplyPacket logReply = new LogoutReplyPacket();
|
||||
logReply.AgentData.AgentID = this.AgentID;
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace OpenSim
|
||||
|
||||
#region Objects/Prims
|
||||
case PacketType.ObjectLink:
|
||||
// OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, Pack.ToString());
|
||||
// OpenSim.Framework.Console.MainLog.Instance.Verbose( Pack.ToString());
|
||||
ObjectLinkPacket link = (ObjectLinkPacket)Pack;
|
||||
uint parentprimid = 0;
|
||||
List<uint> childrenprims = new List<uint>();
|
||||
@@ -514,7 +514,7 @@ namespace OpenSim
|
||||
//Console.WriteLine(Pack.ToString());
|
||||
break;
|
||||
case PacketType.ObjectScale:
|
||||
//OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, Pack.ToString());
|
||||
//OpenSim.Framework.Console.MainLog.Instance.Verbose( Pack.ToString());
|
||||
break;
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace OpenSim
|
||||
m_inventoryCache = inventoryCache;
|
||||
m_authenticateSessionsHandler = authenSessions;
|
||||
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs - Started up new client thread to handle incoming request");
|
||||
OpenSim.Framework.Console.MainLog.Instance.Verbose( "OpenSimClient.cs - Started up new client thread to handle incoming request");
|
||||
cirpack = initialcirpack;
|
||||
userEP = remoteEP;
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace OpenSim
|
||||
|
||||
protected virtual void ClientLoop()
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:ClientLoop() - Entered loop");
|
||||
OpenSim.Framework.Console.MainLog.Instance.Verbose( "OpenSimClient.cs:ClientLoop() - Entered loop");
|
||||
while (true)
|
||||
{
|
||||
QueItem nextPacket = PacketQueue.Dequeue();
|
||||
@@ -210,7 +210,7 @@ namespace OpenSim
|
||||
|
||||
protected virtual void InitNewClient()
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
|
||||
OpenSim.Framework.Console.MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
|
||||
this.m_world.AddNewAvatar(this, this.AgentID, false);
|
||||
}
|
||||
|
||||
@@ -221,12 +221,12 @@ namespace OpenSim
|
||||
if (!sessionInfo.Authorised)
|
||||
{
|
||||
//session/circuit not authorised
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString());
|
||||
OpenSim.Framework.Console.MainLog.Instance.Notice("OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString());
|
||||
ClientThread.Abort();
|
||||
}
|
||||
else
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString());
|
||||
OpenSim.Framework.Console.MainLog.Instance.Notice("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString());
|
||||
//session is authorised
|
||||
this.AgentID = cirpack.CircuitCode.ID;
|
||||
this.SessionID = cirpack.CircuitCode.SessionID;
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace OpenSim
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread");
|
||||
OpenSim.Framework.Console.MainLog.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread");
|
||||
this.KillThread();
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace OpenSim
|
||||
{
|
||||
if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent))
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Resending " + packet.Type.ToString() + " packet, " +
|
||||
OpenSim.Framework.Console.MainLog.Instance.Verbose( "Resending " + packet.Type.ToString() + " packet, " +
|
||||
(now - packet.TickCount) + "ms have passed");
|
||||
|
||||
packet.Header.Resent = true;
|
||||
@@ -273,11 +273,11 @@ namespace OpenSim
|
||||
if (PendingAcks.Count > 250)
|
||||
{
|
||||
// FIXME: Handle the odd case where we have too many pending ACKs queued up
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Too many ACKs queued up!");
|
||||
OpenSim.Framework.Console.MainLog.Instance.Verbose( "Too many ACKs queued up!");
|
||||
return;
|
||||
}
|
||||
|
||||
//OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Sending PacketAck");
|
||||
//OpenSim.Framework.Console.MainLog.Instance.WriteLine("Sending PacketAck");
|
||||
|
||||
|
||||
int i = 0;
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace OpenSim
|
||||
attri = configData.GetAttribute("GridServerURL");
|
||||
if (attri == "")
|
||||
{
|
||||
this.GridURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/");
|
||||
this.GridURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/");
|
||||
configData.SetAttribute("GridServerURL", this.GridURL);
|
||||
}
|
||||
else
|
||||
@@ -73,7 +73,7 @@ namespace OpenSim
|
||||
attri = configData.GetAttribute("GridSendKey");
|
||||
if (attri == "")
|
||||
{
|
||||
this.GridSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to grid server", "null");
|
||||
this.GridSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to grid server", "null");
|
||||
configData.SetAttribute("GridSendKey", this.GridSendKey);
|
||||
}
|
||||
else
|
||||
@@ -86,7 +86,7 @@ namespace OpenSim
|
||||
attri = configData.GetAttribute("GridRecvKey");
|
||||
if (attri == "")
|
||||
{
|
||||
this.GridRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from grid server", "null");
|
||||
this.GridRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from grid server", "null");
|
||||
configData.SetAttribute("GridRecvKey", this.GridRecvKey);
|
||||
}
|
||||
else
|
||||
@@ -98,7 +98,7 @@ namespace OpenSim
|
||||
attri = configData.GetAttribute("AssetServerURL");
|
||||
if (attri == "")
|
||||
{
|
||||
this.AssetURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/");
|
||||
this.AssetURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/");
|
||||
configData.SetAttribute("AssetServerURL", this.GridURL);
|
||||
}
|
||||
else
|
||||
@@ -111,8 +111,8 @@ namespace OpenSim
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Config.cs:InitConfig() - Exception occured");
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, e.ToString());
|
||||
OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured");
|
||||
OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace OpenSim
|
||||
protected BaseHttpServer httpServer;
|
||||
protected List<AuthenticateSessionsBase> AuthenticateSessionsHandler = new List<AuthenticateSessionsBase>();
|
||||
|
||||
protected ConsoleBase m_console;
|
||||
protected LogBase m_log;
|
||||
|
||||
public RegionApplicationBase()
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace OpenSim
|
||||
protected IWorld m_localWorld;
|
||||
protected AssetCache m_assetCache;
|
||||
protected InventoryCache m_inventoryCache;
|
||||
protected ConsoleBase m_console;
|
||||
protected LogBase m_log;
|
||||
protected AuthenticateSessionsBase m_authenticateSessionsClass;
|
||||
|
||||
public PacketServer PacketServer
|
||||
@@ -96,12 +96,12 @@ namespace OpenSim
|
||||
{
|
||||
}
|
||||
|
||||
public UDPServer(int port, AssetCache assetCache, InventoryCache inventoryCache, ConsoleBase console, AuthenticateSessionsBase authenticateClass)
|
||||
public UDPServer(int port, AssetCache assetCache, InventoryCache inventoryCache, LogBase console, AuthenticateSessionsBase authenticateClass)
|
||||
{
|
||||
listenPort = port;
|
||||
this.m_assetCache = assetCache;
|
||||
this.m_inventoryCache = inventoryCache;
|
||||
this.m_console = console;
|
||||
this.m_log = console;
|
||||
this.m_authenticateSessionsClass = authenticateClass;
|
||||
this.CreatePacketServer();
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace OpenSim
|
||||
}
|
||||
else
|
||||
{ // invalid client
|
||||
Console.Error.WriteLine("UDPServer.cs:OnReceivedData() - WARNING: Got a packet from an invalid client - " + epSender.ToString());
|
||||
m_log.Warn("UDPServer.cs:OnReceivedData() - WARNING: Got a packet from an invalid client - " + epSender.ToString());
|
||||
}
|
||||
|
||||
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
|
||||
@@ -151,20 +151,20 @@ namespace OpenSim
|
||||
|
||||
public void ServerListener()
|
||||
{
|
||||
m_console.WriteLine(LogPriority.LOW, "UDPServer.cs:ServerListener() - Opening UDP socket on " + listenPort);
|
||||
m_log.Status("UDPServer.cs:ServerListener() - Opening UDP socket on " + listenPort);
|
||||
|
||||
ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort);
|
||||
Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
|
||||
Server.Bind(ServerIncoming);
|
||||
|
||||
m_console.WriteLine(LogPriority.LOW, "UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen");
|
||||
m_log.Verbose("UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen");
|
||||
|
||||
ipeSender = new IPEndPoint(IPAddress.Any, 0);
|
||||
epSender = (EndPoint)ipeSender;
|
||||
ReceivedData = new AsyncCallback(this.OnReceivedData);
|
||||
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
|
||||
|
||||
m_console.WriteLine(LogPriority.LOW, "UDPServer.cs:ServerListener() - Listening...");
|
||||
m_log.Verbose("UDPServer.cs:ServerListener() - Listening...");
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user