From d8c88f489469cfe900db56d4f2e1450d67bf167c Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 6 Dec 2012 00:22:52 +0000 Subject: [PATCH] Instead of printing script errors out to console, put to debug log so that we also get timestamps. This commit also adds script name, part name, uuid, etc. for later identification. This information has been sent to console since 2009 but may be turned down if it proves too noisy. However, I still currently need it to investigate some region problems probably triggered by scripting. --- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 8e81e9fe30..5ad6eebbc9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -785,6 +785,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance ChatTypeEnum.DebugChannel, 2147483647, part.AbsolutePosition, part.Name, part.UUID, false); + + + m_log.DebugFormat( + "[SCRIPT INSTANCE]: Runtime error in script {0}, part {1} {2} at {3} in {4}, displayed error {5}, actual exception {6}", + ScriptName, + PrimName, + part.UUID, + part.AbsolutePosition, + part.ParentGroup.Scene.Name, + text.Replace("\n", "\\n"), + e.InnerException); } catch (Exception) { @@ -1026,7 +1037,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance "({0}): {1}", scriptLine - 1, e.InnerException.Message); - System.Console.WriteLine(e.ToString()+"\n"); return message; } }