diff options
author | Justin Clark-Casey (justincc) | 2012-02-13 20:43:26 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-02-13 20:43:26 +0000 |
commit | 189c67db957cadfe1bb5bd8aad0c86dec1ff295b (patch) | |
tree | 5bc7edae8044dac005ce841d99a6aad3154a87c3 | |
parent | Fix: Unable to remove AV from friend list (sqldb-bug) http://opensimulator.or... (diff) | |
download | opensim-SC-189c67db957cadfe1bb5bd8aad0c86dec1ff295b.zip opensim-SC-189c67db957cadfe1bb5bd8aad0c86dec1ff295b.tar.gz opensim-SC-189c67db957cadfe1bb5bd8aad0c86dec1ff295b.tar.bz2 opensim-SC-189c67db957cadfe1bb5bd8aad0c86dec1ff295b.tar.xz |
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.
-rw-r--r-- | OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/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 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 | |||
49 | /// <param name="nodeToFill"></param> | 49 | /// <param name="nodeToFill"></param> |
50 | /// <param name="processors">/param> | 50 | /// <param name="processors">/param> |
51 | /// <param name="xtr"></param> | 51 | /// <param name="xtr"></param> |
52 | public static void ExecuteReadProcessors<NodeType>( | 52 | /// <returns>true on successful, false if there were any processing failures</returns> |
53 | public static bool ExecuteReadProcessors<NodeType>( | ||
53 | NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr) | 54 | NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr) |
54 | { | 55 | { |
55 | ExecuteReadProcessors( | 56 | return ExecuteReadProcessors( |
56 | nodeToFill, | 57 | nodeToFill, |
57 | processors, | 58 | processors, |
58 | xtr, | 59 | xtr, |
59 | (o, name, e) | 60 | (o, name, e) |
60 | => m_log.ErrorFormat( | 61 | => m_log.DebugFormat( |
61 | "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}", | 62 | "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}", |
62 | name, e.Message, e.StackTrace)); | 63 | name, e.Message, e.StackTrace)); |
63 | } | 64 | } |
@@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External | |||
71 | /// <param name="parseExceptionAction"> | 72 | /// <param name="parseExceptionAction"> |
72 | /// Action to take if there is a parsing problem. This will usually just be to log the exception | 73 | /// Action to take if there is a parsing problem. This will usually just be to log the exception |
73 | /// </param> | 74 | /// </param> |
74 | public static void ExecuteReadProcessors<NodeType>( | 75 | /// <returns>true on successful, false if there were any processing failures</returns> |
76 | public static bool ExecuteReadProcessors<NodeType>( | ||
75 | NodeType nodeToFill, | 77 | NodeType nodeToFill, |
76 | Dictionary<string, Action<NodeType, XmlTextReader>> processors, | 78 | Dictionary<string, Action<NodeType, XmlTextReader>> processors, |
77 | XmlTextReader xtr, | 79 | XmlTextReader xtr, |
78 | Action<NodeType, string, Exception> parseExceptionAction) | 80 | Action<NodeType, string, Exception> parseExceptionAction) |
79 | { | 81 | { |
82 | bool errors = false; | ||
83 | |||
80 | string nodeName = string.Empty; | 84 | string nodeName = string.Empty; |
81 | while (xtr.NodeType != XmlNodeType.EndElement) | 85 | while (xtr.NodeType != XmlNodeType.EndElement) |
82 | { | 86 | { |
@@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External | |||
95 | } | 99 | } |
96 | catch (Exception e) | 100 | catch (Exception e) |
97 | { | 101 | { |
102 | errors = true; | ||
98 | parseExceptionAction(nodeToFill, nodeName, e); | 103 | parseExceptionAction(nodeToFill, nodeName, e); |
99 | 104 | ||
100 | if (xtr.NodeType == XmlNodeType.EndElement) | 105 | if (xtr.NodeType == XmlNodeType.EndElement) |
@@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External | |||
107 | xtr.ReadOuterXml(); // ignore | 112 | xtr.ReadOuterXml(); // ignore |
108 | } | 113 | } |
109 | } | 114 | } |
115 | |||
116 | return errors; | ||
110 | } | 117 | } |
111 | 118 | ||
112 | /// <summary> | 119 | /// <summary> |
@@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External | |||
140 | UUID.TryParse(node.InnerText, out uuid); | 147 | UUID.TryParse(node.InnerText, out uuid); |
141 | creator = userService.GetUserAccount(scopeID, uuid); | 148 | creator = userService.GetUserAccount(scopeID, uuid); |
142 | } | 149 | } |
150 | |||
143 | if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty) | 151 | if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty) |
144 | hasCreatorData = true; | 152 | hasCreatorData = true; |
145 | 153 | ||
@@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External | |||
163 | doc.Save(wr); | 171 | doc.Save(wr); |
164 | return wr.ToString(); | 172 | return wr.ToString(); |
165 | } | 173 | } |
166 | |||
167 | } | 174 | } |
168 | } | 175 | } |
169 | } | 176 | } \ 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 ab02f92..0a32214 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 | |||
1470 | m_SOPXmlProcessors, | 1470 | m_SOPXmlProcessors, |
1471 | reader, | 1471 | reader, |
1472 | (o, nodeName, e) | 1472 | (o, nodeName, e) |
1473 | => m_log.ErrorFormat( | 1473 | => m_log.DebugFormat( |
1474 | "[SceneObjectSerializer]: Exception while parsing {0} in object {1} {2}: {3}{4}", | 1474 | "[SceneObjectSerializer]: Exception while parsing {0} in object {1} {2}: {3}{4}", |
1475 | ((SceneObjectPart)o).Name, ((SceneObjectPart)o).UUID, nodeName, e.Message, e.StackTrace)); | 1475 | ((SceneObjectPart)o).Name, ((SceneObjectPart)o).UUID, nodeName, e.Message, e.StackTrace)); |
1476 | 1476 | ||
@@ -1535,14 +1535,18 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1535 | 1535 | ||
1536 | reader.ReadStartElement(name, String.Empty); // Shape | 1536 | reader.ReadStartElement(name, String.Empty); // Shape |
1537 | 1537 | ||
1538 | ExternalRepresentationUtils.ExecuteReadProcessors( | 1538 | errors = ExternalRepresentationUtils.ExecuteReadProcessors( |
1539 | shape, | 1539 | shape, |
1540 | m_ShapeXmlProcessors, | 1540 | m_ShapeXmlProcessors, |
1541 | reader, | 1541 | reader, |
1542 | (o, nodeName, e) | 1542 | (o, nodeName, e) |
1543 | => m_log.ErrorFormat( | 1543 | => |
1544 | "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", | 1544 | { |
1545 | nodeName, e.Message, e.StackTrace)); | 1545 | m_log.DebugFormat( |
1546 | "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", | ||
1547 | nodeName, e.Message, e.StackTrace); | ||
1548 | } | ||
1549 | ); | ||
1546 | 1550 | ||
1547 | reader.ReadEndElement(); // Shape | 1551 | reader.ReadEndElement(); // Shape |
1548 | 1552 | ||