[Piglit] [PATCH 12/26] log.py: PEP8 compliance
Dylan Baker
baker.dylan.c at gmail.com
Wed Jul 10 15:19:03 PDT 2013
---
framework/log.py | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/framework/log.py b/framework/log.py
index 2db2e28..310c552 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
--
1.8.3.1
More information about the Piglit
mailing list