diff options
author | Kevin Rocard <kevinx.rocard@intel.com> | 2012-11-30 11:24:20 +0100 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-12 17:03:30 +0100 |
commit | 57096bd2de45c840090503d70f40b79565e38881 (patch) | |
tree | 72ff2440533d6a3e5c4d577b78212b01898cc7d5 /parameter/XmlFileIncluderElement.cpp | |
parent | 8d6e34b5fed9d64266cb9dae35677dd19eb641b6 (diff) | |
download | external_parameter-framework-57096bd2de45c840090503d70f40b79565e38881.zip external_parameter-framework-57096bd2de45c840090503d70f40b79565e38881.tar.gz external_parameter-framework-57096bd2de45c840090503d70f40b79565e38881.tar.bz2 |
PFW: Improve login in PFW core and amixer plugin
BZ: 71914
Autolog adds a nesting log level. It is not always needed. For example in a
Debug context a lot of log can be expected, so this level is useful but not
otherwise.
Autolog nesting is now optional.
Add log during PFW structure loading.
Change-Id: I24e1f615e3032c70a3b8b85a1cc1804dc49b631c
Origin-Change-Id: I1f2c6c843e17595d4a81c1d2dfbff30d4187cdf8
Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com>
Reviewed-on: http://android.intel.com:8080/81269
Reviewed-by: Barthes, FabienX <fabienx.barthes@intel.com>
Tested-by: Barthes, FabienX <fabienx.barthes@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: cactus <cactus@intel.com>
Diffstat (limited to 'parameter/XmlFileIncluderElement.cpp')
-rw-r--r-- | parameter/XmlFileIncluderElement.cpp | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/parameter/XmlFileIncluderElement.cpp b/parameter/XmlFileIncluderElement.cpp index 4986758..06f64ff 100644 --- a/parameter/XmlFileIncluderElement.cpp +++ b/parameter/XmlFileIncluderElement.cpp @@ -27,6 +27,7 @@ #include "XmlMemoryDocSink.h" #include "XmlElementSerializingContext.h" #include "ElementLibrary.h" +#include "AutoLog.h" #include <assert.h> #define base CKindElement @@ -53,41 +54,45 @@ bool CXmlFileIncluderElement::fromXml(const CXmlElement& xmlElement, CXmlSeriali // Instantiate parser string strIncludedElementType = getIncludedElementType(); - // Use a doc source that load data from a file - CXmlFileDocSource fileDocSource(strPath, elementSerializingContext.getXmlSchemaPathFolder() + "/" + strIncludedElementType + ".xsd", strIncludedElementType); + { + // Open a log section titled with loading file path + CAutoLog autolog(this, "Loading " + strPath); - if (!fileDocSource.isParsable(elementSerializingContext)) { + // Use a doc source that load data from a file + CXmlFileDocSource fileDocSource(strPath, elementSerializingContext.getXmlSchemaPathFolder() + "/" + strIncludedElementType + ".xsd", strIncludedElementType); - return false; - } + if (!fileDocSource.isParsable(elementSerializingContext)) { - // Get top level element - CXmlElement childElement; + return false; + } - fileDocSource.getRootElement(childElement); + // Get top level element + CXmlElement childElement; - // Create child element - CElement* pChild = elementSerializingContext.getElementLibrary()->createElement(childElement); + fileDocSource.getRootElement(childElement); - if (pChild) { + // Create child element + CElement* pChild = elementSerializingContext.getElementLibrary()->createElement(childElement); - // Store created child! - getParent()->addChild(pChild); - } else { + if (pChild) { - elementSerializingContext.setError("Unable to create XML element " + childElement.getPath()); + // Store created child! + getParent()->addChild(pChild); + } else { - return false; - } + elementSerializingContext.setError("Unable to create XML element " + childElement.getPath()); - // Use a doc sink that instantiate the structure from the doc source - CXmlMemoryDocSink memorySink(pChild); + return false; + } - if (!memorySink.process(fileDocSource, elementSerializingContext)) { + // Use a doc sink that instantiate the structure from the doc source + CXmlMemoryDocSink memorySink(pChild); - return false; - } + if (!memorySink.process(fileDocSource, elementSerializingContext)) { + return false; + } + } // Detach from parent getParent()->removeChild(this); |