From 189c67db957cadfe1bb5bd8aad0c86dec1ff295b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 13 Feb 2012 20:43:26 +0000 Subject: 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 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index a392af6..c56f213 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 -- cgit v1.1