summaryrefslogtreecommitdiff
path: root/jfr_playoff/logger.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-02-23 19:37:53 +0100
committeremkael <emkael@tlen.pl>2018-02-23 19:37:53 +0100
commitb30e786b2f647151fbc358d185d13e45cbc75b84 (patch)
tree3d9191994d2ba3e463de2d345915fe3c47fdb624 /jfr_playoff/logger.py
parent65ecd399ea82abdafd0a2471193a9c850b50db87 (diff)
Logging facility configured by command line arguments
Diffstat (limited to 'jfr_playoff/logger.py')
-rw-r--r--jfr_playoff/logger.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/jfr_playoff/logger.py b/jfr_playoff/logger.py
new file mode 100644
index 0000000..8944e5b
--- /dev/null
+++ b/jfr_playoff/logger.py
@@ -0,0 +1,15 @@
+import logging as log
+
+
+class PlayoffLogger:
+
+ @classmethod
+ def setup(cls, level):
+ log.basicConfig(
+ level=getattr(log, level),
+ streamhandler=log.StreamHandler(),
+ format='%(levelname)-8s %(name)-8s %(message)s')
+
+ @classmethod
+ def get(cls, category=''):
+ return log.getLogger(category)