From 05a710bcfa3c9799d99fd53c802fd569191681f7 Mon Sep 17 00:00:00 2001 From: "U. Artie Eoff" Date: Mon, 7 Feb 2011 18:54:57 -0800 Subject: Add synchronization to Logger functions. Add synchronization decorator to Logger functions for multithreaded logging support. --- framework/log.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'framework') 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( -- cgit v1.2.3