aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-05-18 03:43:36 +0100
committerJustin Clark-Casey (justincc)2012-05-18 03:43:36 +0100
commit45af29291acd22700d9fc4c442655d2e3f19a0b0 (patch)
tree4768a05b52e0796829395c0d1674556fbffb356e /OpenSim/Region
parentInvoke log4net configurator in pCampBot.exe in order to get OpenSim sylte log... (diff)
downloadopensim-SC_OLD-45af29291acd22700d9fc4c442655d2e3f19a0b0.zip
opensim-SC_OLD-45af29291acd22700d9fc4c442655d2e3f19a0b0.tar.gz
opensim-SC_OLD-45af29291acd22700d9fc4c442655d2e3f19a0b0.tar.bz2
opensim-SC_OLD-45af29291acd22700d9fc4c442655d2e3f19a0b0.tar.xz
Add level 2 debug eq logging which logs event queue polls.
Refactor: eq message logging into common method.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs55
1 files changed, 32 insertions, 23 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index 0054619..6ac19cc 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -109,10 +109,11 @@ namespace OpenSim.Region.ClientStack.Linden
109 "Comms", 109 "Comms",
110 false, 110 false,
111 "debug eq", 111 "debug eq",
112 "debug eq [0|1]", 112 "debug eq [0|1|2]",
113 "Turn on event queue debugging", 113 "Turn on event queue debugging",
114 "debug eq 1 will turn on event queue debugging. This will log all outgoing event queue messages to clients.\n" 114 "<= 0 - turns off all event queue logging",
115 + "debug eq 0 will turn off event queue debugging.", 115 ">= 1 - turns on outgoing event logging",
116 ">= 2 - turns on poll notification",
116 HandleDebugEq); 117 HandleDebugEq);
117 } 118 }
118 else 119 else
@@ -270,7 +271,9 @@ namespace OpenSim.Region.ClientStack.Linden
270 string eqgPath = GenerateEqgCapPath(eventQueueGetUuid); 271 string eqgPath = GenerateEqgCapPath(eventQueueGetUuid);
271 MainServer.Instance.RemovePollServiceHTTPHandler("", eqgPath); 272 MainServer.Instance.RemovePollServiceHTTPHandler("", eqgPath);
272 273
273// m_log.DebugFormat("[EVENT QUEUE GET MODULE]: Removed EQG handler {0} for {1}", eqgPath, agentID); 274 m_log.DebugFormat(
275 "[EVENT QUEUE GET MODULE]: Removed EQG handler {0} for {1} in {2}",
276 eqgPath, agentID, m_scene.RegionInfo.RegionName);
274 } 277 }
275 } 278 }
276 279
@@ -376,9 +379,9 @@ namespace OpenSim.Region.ClientStack.Linden
376 eventQueueGetPath, 379 eventQueueGetPath,
377 new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID)); 380 new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID));
378 381
379// m_log.DebugFormat( 382 m_log.DebugFormat(
380// "[EVENT QUEUE GET MODULE]: Registered EQG handler {0} for {1} in {2}", 383 "[EVENT QUEUE GET MODULE]: Registered EQG handler {0} for {1} in {2}",
381// eventQueueGetPath, agentID, m_scene.RegionInfo.RegionName); 384 eventQueueGetPath, agentID, m_scene.RegionInfo.RegionName);
382 385
383 Random rnd = new Random(Environment.TickCount); 386 Random rnd = new Random(Environment.TickCount);
384 lock (m_ids) 387 lock (m_ids)
@@ -401,9 +404,25 @@ namespace OpenSim.Region.ClientStack.Linden
401 return false; 404 return false;
402 } 405 }
403 406
407 /// <summary>
408 /// Logs a debug line for an outbound event queue message if appropriate.
409 /// </summary>
410 /// <param name='element'>Element containing message</param>
411 private void LogOutboundDebugMessage(OSD element, UUID agentId)
412 {
413 if (element is OSDMap)
414 {
415 OSDMap ev = (OSDMap)element;
416 m_log.DebugFormat(
417 "Eq OUT {0,-30} to {1,-20} {2,-20}",
418 ev["message"], m_scene.GetScenePresence(agentId).Name, m_scene.RegionInfo.RegionName);
419 }
420 }
421
404 public Hashtable GetEvents(UUID requestID, UUID pAgentId, string request) 422 public Hashtable GetEvents(UUID requestID, UUID pAgentId, string request)
405 { 423 {
406// m_log.DebugFormat("[EVENT QUEUE GET MODULE]: Invoked GetEvents() for {0}", pAgentId); 424 if (DebugLevel >= 2)
425 m_log.DebugFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.RegionInfo.RegionName);
407 426
408 Queue<OSD> queue = TryGetQueue(pAgentId); 427 Queue<OSD> queue = TryGetQueue(pAgentId);
409 OSD element; 428 OSD element;
@@ -427,13 +446,8 @@ namespace OpenSim.Region.ClientStack.Linden
427 } 446 }
428 else 447 else
429 { 448 {
430 if (DebugLevel > 0 && element is OSDMap) 449 if (DebugLevel > 0)
431 { 450 LogOutboundDebugMessage(element, pAgentId);
432 OSDMap ev = (OSDMap)element;
433 m_log.DebugFormat(
434 "[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}",
435 ev["message"], m_scene.GetScenePresence(pAgentId).Name);
436 }
437 451
438 array.Add(element); 452 array.Add(element);
439 453
@@ -443,13 +457,8 @@ namespace OpenSim.Region.ClientStack.Linden
443 { 457 {
444 element = queue.Dequeue(); 458 element = queue.Dequeue();
445 459
446 if (DebugLevel > 0 && element is OSDMap) 460 if (DebugLevel > 0)
447 { 461 LogOutboundDebugMessage(element, pAgentId);
448 OSDMap ev = (OSDMap)element;
449 m_log.DebugFormat(
450 "[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}",
451 ev["message"], m_scene.GetScenePresence(pAgentId).Name);
452 }
453 462
454 array.Add(element); 463 array.Add(element);
455 thisID++; 464 thisID++;