summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Wagner <david.wagner@intel.com>2015-01-15 19:43:56 +0100
committerDavid Wagner <david.wagner@intel.com>2015-01-28 20:02:50 +0100
commite6711f76f6baaccf449e85b2105fc0e64b20ab9a (patch)
treee5c9b4cd54b477e4457a1f8d01ce837314e4dcb7 /tools
parent171814cc5a36305066b17ec1f55f15a01adfdbf8 (diff)
downloadexternal_parameter-framework-e6711f76f6baaccf449e85b2105fc0e64b20ab9a.zip
external_parameter-framework-e6711f76f6baaccf449e85b2105fc0e64b20ab9a.tar.gz
external_parameter-framework-e6711f76f6baaccf449e85b2105fc0e64b20ab9a.tar.bz2
domainGenerator.py: pass a logger to the parameter-framework
Take advantage of the setLogger() method that was newly added to the bindings to allow the parameter-framework to log during XML generation. Change-Id: I71a43fae915756a7986a48a840306d454d071f17 Signed-off-by: David Wagner <david.wagner@intel.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/xmlGenerator/domainGenerator.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/xmlGenerator/domainGenerator.py b/tools/xmlGenerator/domainGenerator.py
index 83c71ea..516a3bd 100755
--- a/tools/xmlGenerator/domainGenerator.py
+++ b/tools/xmlGenerator/domainGenerator.py
@@ -108,6 +108,15 @@ class PfwTranslationErrorHandler:
def hasFailed(self):
return self._hasFailed
+class PfwLogger(PyPfw.ILogger):
+ def __init__(self):
+ super(PfwLogger, self).__init__()
+ self.__logger = logging.root.getChild("parameter-framework")
+
+ def log(self, is_warning, message):
+ log_func = self.__logger.warning if is_warning else self.__logger.info
+ log_func(message)
+
# If this file is directly executed
if __name__ == "__main__":
logging.root.setLevel(logging.INFO)
@@ -263,6 +272,9 @@ if __name__ == "__main__":
schemas_dir = os.path.join(install_path, "Schemas")
pfw.setSchemaFolderLocation(schemas_dir)
+ logger = PfwLogger()
+ pfw.setLogger(logger)
+
# Finally, start the Pfw
ok, error = pfw.start()
if not ok: