aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-12-03 20:48:17 +0000
committerJustin Clark-Casey (justincc)2014-12-03 20:48:17 +0000
commitc3c05a86939de9669c1065d0a738a2a9b0f30c27 (patch)
treef8be224d4e5343f1effe26027fe3f7d0fa359254 /OpenSim/Region/ScriptEngine/XEngine
parentminor: improve logged error in XEngine.SetXmlState if there was a problem wri... (diff)
downloadopensim-SC-c3c05a86939de9669c1065d0a738a2a9b0f30c27.zip
opensim-SC-c3c05a86939de9669c1065d0a738a2a9b0f30c27.tar.gz
opensim-SC-c3c05a86939de9669c1065d0a738a2a9b0f30c27.tar.bz2
opensim-SC-c3c05a86939de9669c1065d0a738a2a9b0f30c27.tar.xz
Reintroduce general xengine extra debugging log level. This can be controlled at runtime with the command "debug xengine log <level>", as with similar commands.
If log level is 1 then every script load is logged. This means the <logger name="OpenSim.Region.ScriptEngine.XEngine"> section in OpenSim.exe.config is no longer needed to avoid log spam on regions with many scripts and can be removed.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs63
1 files changed, 32 insertions, 31 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index e5c11d8..bd11451 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
70 /// <remarks> 70 /// <remarks>
71 /// If DebugLevel >= 1, then we log every time that a script is started. 71 /// If DebugLevel >= 1, then we log every time that a script is started.
72 /// </remarks> 72 /// </remarks>
73// public int DebugLevel { get; set; } 73 public int DebugLevel { get; set; }
74 74
75 private SmartThreadPool m_ThreadPool; 75 private SmartThreadPool m_ThreadPool;
76 private int m_MaxScriptQueue; 76 private int m_MaxScriptQueue;
@@ -403,12 +403,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
403 + "Level >= 2, log event invocations.\n", 403 + "Level >= 2, log event invocations.\n",
404 HandleDebugScriptLogCommand); 404 HandleDebugScriptLogCommand);
405 405
406// MainConsole.Instance.Commands.AddCommand( 406 MainConsole.Instance.Commands.AddCommand(
407// "Debug", false, "debug xengine", "debug xengine [<level>]", 407 "Debug", false, "debug xengine log", "debug xengine log [<level>]",
408// "Turn on detailed xengine debugging.", 408 "Turn on detailed xengine debugging.",
409// "If level <= 0, then no extra logging is done.\n" 409 "If level <= 0, then no extra logging is done.\n"
410// + "If level >= 1, then we log every time that a script is started.", 410 + "If level >= 1, then we log every time that a script is started.",
411// HandleDebugLevelCommand); 411 HandleDebugLevelCommand);
412 } 412 }
413 413
414 private void HandleDebugScriptLogCommand(string module, string[] args) 414 private void HandleDebugScriptLogCommand(string module, string[] args)
@@ -451,26 +451,26 @@ namespace OpenSim.Region.ScriptEngine.XEngine
451 /// </summary> 451 /// </summary>
452 /// <param name="module"></param> 452 /// <param name="module"></param>
453 /// <param name="args"></param> 453 /// <param name="args"></param>
454// private void HandleDebugLevelCommand(string module, string[] args) 454 private void HandleDebugLevelCommand(string module, string[] args)
455// { 455 {
456// if (args.Length == 3) 456 if (args.Length <= 4)
457// { 457 {
458// int newDebug; 458 int newDebug;
459// if (int.TryParse(args[2], out newDebug)) 459 if (ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, args[3], out newDebug))
460// { 460 {
461// DebugLevel = newDebug; 461 DebugLevel = newDebug;
462// MainConsole.Instance.OutputFormat("Debug level set to {0}", newDebug); 462 MainConsole.Instance.OutputFormat("Debug level set to {0} in XEngine for region {1}", newDebug, m_Scene.Name);
463// } 463 }
464// } 464 }
465// else if (args.Length == 2) 465 else if (args.Length == 3)
466// { 466 {
467// MainConsole.Instance.OutputFormat("Current debug level is {0}", DebugLevel); 467 MainConsole.Instance.OutputFormat("Current debug level is {0}", DebugLevel);
468// } 468 }
469// else 469 else
470// { 470 {
471// MainConsole.Instance.Output("Usage: debug xengine 0..1"); 471 MainConsole.Instance.Output("Usage: debug xengine log <level>");
472// } 472 }
473// } 473 }
474 474
475 /// <summary> 475 /// <summary>
476 /// Parse the raw item id into a script instance from the command params if it's present. 476 /// Parse the raw item id into a script instance from the command params if it's present.
@@ -1148,10 +1148,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1148 return false; 1148 return false;
1149 } 1149 }
1150 1150
1151 m_log.DebugFormat( 1151 if (DebugLevel > 0)
1152 "[XEngine]: Loading script {0}.{1}, item UUID {2}, prim UUID {3} @ {4}.{5}", 1152 m_log.DebugFormat(
1153 part.ParentGroup.RootPart.Name, item.Name, itemID, part.UUID, 1153 "[XEngine]: Loading script {0}.{1}, item UUID {2}, prim UUID {3} @ {4}.{5}",
1154 part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName); 1154 part.ParentGroup.RootPart.Name, item.Name, itemID, part.UUID,
1155 part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName);
1155 1156
1156 UUID assetID = item.AssetID; 1157 UUID assetID = item.AssetID;
1157 1158