From 189c67db957cadfe1bb5bd8aad0c86dec1ff295b Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 13 Feb 2012 20:43:26 +0000 Subject: [PATCH] On object deserialization, go back to logging errors at DEBUG level rather than ERROR. Restore extra log message if shape processing fails. Logging level was DEBUG before 312e145 (Fri Feb 3 2012). 312e145 also accidentally removed the 'general error' log message if any shape deserialization failed. This commit restores it, though this has no functional impact. --- .../External/ExternalRepresentationUtils.cs | 19 +++++++++++++------ .../Serialization/SceneObjectSerializer.cs | 14 +++++++++----- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index a392af66aa..c56f21367f 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs @@ -49,15 +49,16 @@ namespace OpenSim.Framework.Serialization.External /// /// /param> /// - public static void ExecuteReadProcessors( + /// true on successful, false if there were any processing failures + public static bool ExecuteReadProcessors( NodeType nodeToFill, Dictionary> processors, XmlTextReader xtr) { - ExecuteReadProcessors( + return ExecuteReadProcessors( nodeToFill, processors, xtr, (o, name, e) - => m_log.ErrorFormat( + => m_log.DebugFormat( "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}", name, e.Message, e.StackTrace)); } @@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External /// /// Action to take if there is a parsing problem. This will usually just be to log the exception /// - public static void ExecuteReadProcessors( + /// true on successful, false if there were any processing failures + public static bool ExecuteReadProcessors( NodeType nodeToFill, Dictionary> processors, XmlTextReader xtr, Action parseExceptionAction) { + bool errors = false; + string nodeName = string.Empty; while (xtr.NodeType != XmlNodeType.EndElement) { @@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External } catch (Exception e) { + errors = true; parseExceptionAction(nodeToFill, nodeName, e); if (xtr.NodeType == XmlNodeType.EndElement) @@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External xtr.ReadOuterXml(); // ignore } } + + return errors; } /// @@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External UUID.TryParse(node.InnerText, out uuid); creator = userService.GetUserAccount(scopeID, uuid); } + if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty) hasCreatorData = true; @@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External doc.Save(wr); return wr.ToString(); } - } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index ab02f92c83..0a32214661 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -1470,7 +1470,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization m_SOPXmlProcessors, reader, (o, nodeName, e) - => m_log.ErrorFormat( + => m_log.DebugFormat( "[SceneObjectSerializer]: Exception while parsing {0} in object {1} {2}: {3}{4}", ((SceneObjectPart)o).Name, ((SceneObjectPart)o).UUID, nodeName, e.Message, e.StackTrace)); @@ -1535,14 +1535,18 @@ namespace OpenSim.Region.Framework.Scenes.Serialization reader.ReadStartElement(name, String.Empty); // Shape - ExternalRepresentationUtils.ExecuteReadProcessors( + errors = ExternalRepresentationUtils.ExecuteReadProcessors( shape, m_ShapeXmlProcessors, reader, (o, nodeName, e) - => m_log.ErrorFormat( - "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", - nodeName, e.Message, e.StackTrace)); + => + { + m_log.DebugFormat( + "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", + nodeName, e.Message, e.StackTrace); + } + ); reader.ReadEndElement(); // Shape