From b30e786b2f647151fbc358d185d13e45cbc75b84 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 23 Feb 2018 19:37:53 +0100 Subject: Logging facility configured by command line arguments --- jfr_playoff/logger.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 jfr_playoff/logger.py (limited to 'jfr_playoff') 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) -- cgit v1.2.3