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.
mb-throttle-test
Justin Clark-Casey (justincc) 2014-12-03 20:48:17 +00:00
parent 805b7ccb3e
commit c3c05a8693
2 changed files with 32 additions and 36 deletions

View File

@ -70,7 +70,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
/// <remarks> /// <remarks>
/// If DebugLevel >= 1, then we log every time that a script is started. /// If DebugLevel >= 1, then we log every time that a script is started.
/// </remarks> /// </remarks>
// public int DebugLevel { get; set; } public int DebugLevel { get; set; }
private SmartThreadPool m_ThreadPool; private SmartThreadPool m_ThreadPool;
private int m_MaxScriptQueue; private int m_MaxScriptQueue;
@ -403,12 +403,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
+ "Level >= 2, log event invocations.\n", + "Level >= 2, log event invocations.\n",
HandleDebugScriptLogCommand); HandleDebugScriptLogCommand);
// MainConsole.Instance.Commands.AddCommand( MainConsole.Instance.Commands.AddCommand(
// "Debug", false, "debug xengine", "debug xengine [<level>]", "Debug", false, "debug xengine log", "debug xengine log [<level>]",
// "Turn on detailed xengine debugging.", "Turn on detailed xengine debugging.",
// "If level <= 0, then no extra logging is done.\n" "If level <= 0, then no extra logging is done.\n"
// + "If level >= 1, then we log every time that a script is started.", + "If level >= 1, then we log every time that a script is started.",
// HandleDebugLevelCommand); HandleDebugLevelCommand);
} }
private void HandleDebugScriptLogCommand(string module, string[] args) private void HandleDebugScriptLogCommand(string module, string[] args)
@ -451,26 +451,26 @@ namespace OpenSim.Region.ScriptEngine.XEngine
/// </summary> /// </summary>
/// <param name="module"></param> /// <param name="module"></param>
/// <param name="args"></param> /// <param name="args"></param>
// private void HandleDebugLevelCommand(string module, string[] args) private void HandleDebugLevelCommand(string module, string[] args)
// { {
// if (args.Length == 3) if (args.Length <= 4)
// { {
// int newDebug; int newDebug;
// if (int.TryParse(args[2], out newDebug)) if (ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, args[3], out newDebug))
// { {
// DebugLevel = newDebug; DebugLevel = newDebug;
// MainConsole.Instance.OutputFormat("Debug level set to {0}", newDebug); MainConsole.Instance.OutputFormat("Debug level set to {0} in XEngine for region {1}", newDebug, m_Scene.Name);
// } }
// } }
// else if (args.Length == 2) else if (args.Length == 3)
// { {
// MainConsole.Instance.OutputFormat("Current debug level is {0}", DebugLevel); MainConsole.Instance.OutputFormat("Current debug level is {0}", DebugLevel);
// } }
// else else
// { {
// MainConsole.Instance.Output("Usage: debug xengine 0..1"); MainConsole.Instance.Output("Usage: debug xengine log <level>");
// } }
// } }
/// <summary> /// <summary>
/// Parse the raw item id into a script instance from the command params if it's present. /// 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
return false; return false;
} }
m_log.DebugFormat( if (DebugLevel > 0)
"[XEngine]: Loading script {0}.{1}, item UUID {2}, prim UUID {3} @ {4}.{5}", m_log.DebugFormat(
part.ParentGroup.RootPart.Name, item.Name, itemID, part.UUID, "[XEngine]: Loading script {0}.{1}, item UUID {2}, prim UUID {3} @ {4}.{5}",
part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName); part.ParentGroup.RootPart.Name, item.Name, itemID, part.UUID,
part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName);
UUID assetID = item.AssetID; UUID assetID = item.AssetID;

View File

@ -57,11 +57,6 @@
<appender-ref ref="LogFileAppender" /> <appender-ref ref="LogFileAppender" />
</root> </root>
<!-- Independently control logging level for XEngine -->
<logger name="OpenSim.Region.ScriptEngine.XEngine">
<level value="INFO"/>
</logger>
<!-- Independently control logging level for per region module loading --> <!-- Independently control logging level for per region module loading -->
<logger name="OpenSim.ApplicationPlugins.RegionModulesController.RegionModulesControllerPlugin"> <logger name="OpenSim.ApplicationPlugins.RegionModulesController.RegionModulesControllerPlugin">
<level value="INFO"/> <level value="INFO"/>