diff options
author | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2011-02-07 18:54:57 -0800 |
---|---|---|
committer | Chad Versace <chad.versace@intel.com> | 2011-02-10 13:38:23 -0800 |
commit | 05a710bcfa3c9799d99fd53c802fd569191681f7 (patch) | |
tree | f22131d55b248ccd38933065b66fd265d5c8a818 /framework | |
parent | 6388cf7b8fe1b84be2cbaf9292c078b287803f96 (diff) |
Add synchronization to Logger functions.
Add synchronization decorator to Logger functions for multithreaded
logging support.
Diffstat (limited to 'framework')
-rw-r--r-- | framework/log.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/framework/log.py b/framework/log.py index c3fbdd77..e90137aa 100644 --- a/framework/log.py +++ b/framework/log.py @@ -21,13 +21,16 @@ # IN THE SOFTWARE. # +from threads import synchronized_self from patterns import Singleton import logging class Logger(Singleton): + @synchronized_self def __logMessage(self, logfunc, message, **kwargs): [logfunc(line, **kwargs) for line in message.split('\n')] + @synchronized_self def getLogger(self, channel = None): if 0 == len(logging.root.handlers): logging.basicConfig( |