From a58f5b2f6679bfb8565741afaead7e6d8dc8c299 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Nov 2011 22:08:34 +0000 Subject: When setting packet level logging via "debug packet", apply to all clients, not just root ones. Also adds scene name and client type (root|child) to logged information. --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 18 +++++++++------- OpenSim/Region/Framework/Scenes/SceneManager.cs | 24 +++++++++------------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 133da0f..7d39ddc 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -11621,7 +11621,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP logPacket = false; if (logPacket) - m_log.DebugFormat("[CLIENT]: Packet OUT {0} to {1}", packet.Type, Name); + m_log.DebugFormat( + "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}", + Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type); } m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method); @@ -11664,19 +11666,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP { if (DebugPacketLevel > 0) { - bool outputPacket = true; + bool logPacket = true; if (DebugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate) - outputPacket = false; + logPacket = false; if (DebugPacketLevel <= 200 && packet.Type == PacketType.RequestImage) - outputPacket = false; + logPacket = false; if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) - outputPacket = false; + logPacket = false; - if (outputPacket) - m_log.DebugFormat("[CLIENT]: Packet IN {0} from {1}", packet.Type, Name); + if (logPacket) + m_log.DebugFormat( + "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}", + Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type); } if (!ProcessPacketMethod(packet)) diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index eeb087f..82458e2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs @@ -448,29 +448,25 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Set the debug packet level on the current scene. This level governs which packets are printed out to the + /// Set the debug packet level on each current scene. This level governs which packets are printed out to the /// console. /// /// /// Name of avatar to debug public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name) { - ForEachCurrentScene( - delegate(Scene scene) + ForEachCurrentScene(scene => + scene.ForEachScenePresence(sp => { - scene.ForEachRootClient(delegate(IClientAPI client) + if (name == null || sp.Name == name) { - if (name == null || client.Name == name) - { - m_log.DebugFormat("Packet debug for {0} {1} set to {2}", - client.FirstName, - client.LastName, - newDebug); + m_log.DebugFormat( + "Packet debug for {0} ({1}) set to {2}", + sp.Name, sp.IsChildAgent ? "child" : "root", newDebug); - client.DebugPacketLevel = newDebug; - } - }); - } + sp.ControllingClient.DebugPacketLevel = newDebug; + } + }) ); } -- cgit v1.1