Alon Bar-Lev has uploaded a new change for review.

Change subject: core: logging: prefix all logs with 'otopi.'
......................................................................

core: logging: prefix all logs with 'otopi.'

This is needed so that external implementations will use the same
log hierarchy.

Change-Id: I46329f3e85eafeb01e3234dfc177168fb487c2b4
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M src/otopi/base.py
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/otopi refs/changes/18/11518/1

diff --git a/src/otopi/base.py b/src/otopi/base.py
index 90a4713..6169ca4 100644
--- a/src/otopi/base.py
+++ b/src/otopi/base.py
@@ -31,6 +31,8 @@
 class Base(object):
     """Base class for all objects."""
 
+    _LOG_PREFIX = 'otopi.'
+
     @property
     def logger(self):
         """Logger."""
@@ -38,7 +40,12 @@
 
     def __init__(self):
         """Contructor."""
-        self._logger = logging.getLogger(self.__module__)
+
+        prefix = ''
+        if not self.__module__.startswith(self._LOG_PREFIX):
+            prefix = self._LOG_PREFIX
+
+        self._logger = logging.getLogger(prefix + self.__module__)
 
 
 # vim: expandtab tabstop=4 shiftwidth=4


--
To view, visit http://gerrit.ovirt.org/11518
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46329f3e85eafeb01e3234dfc177168fb487c2b4
Gerrit-PatchSet: 1
Gerrit-Project: otopi
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to