summaryrefslogtreecommitdiff
path: root/framework/log.py
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2013-07-06 08:12:15 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2013-07-29 12:01:00 -0700
commit3633a125692bc17c84ee23f610761a0966cd0757 (patch)
tree2f585ad209908e7f9977443ee54d5d6bd7769256 /framework/log.py
parent2ec9f23f831588650476058bde5d12bae3954f1c (diff)
log.py: PEP8 compliance
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'framework/log.py')
-rw-r--r--framework/log.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/framework/log.py b/framework/log.py
index 2db2e2814..310c552ea 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -21,9 +21,11 @@
# IN THE SOFTWARE.
#
+import logging
+
from threads import synchronized_self
from patterns import Singleton
-import logging
+
class Logger(Singleton):
@synchronized_self
@@ -31,19 +33,21 @@ class Logger(Singleton):
[logfunc(line, **kwargs) for line in message.split('\n')]
@synchronized_self
- def getLogger(self, channel = None):
+ def getLogger(self, channel=None):
if 0 == len(logging.root.handlers):
- logging.basicConfig(
- format = "[%(asctime)s] :: %(message)+8s :: %(name)s",
- datefmt = "%c",
- level = logging.INFO,
- )
+ logging.basicConfig(format="[%(asctime)s] :: %(message)+8s "
+ ":: %(name)s",
+ datefmt="%c",
+ level=logging.INFO)
if channel is None:
channel = "base"
logger = logging.getLogger(channel)
return logger
- def log(self, type = logging.INFO, msg = "", channel = None):
- self.__logMessage(lambda m, **kwargs: self.getLogger(channel).log(type, m, **kwargs), msg)
+ def log(self, type=logging.INFO, msg="", channel=None):
+ self.__logMessage(lambda m,
+ **kwargs: self.getLogger(channel).log(type,
+ m,
+ **kwargs), msg)
log = Logger().log