blob: 3f15c49f26e0d26452eacc491c422ce361b6ea8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import logging as log
import sys
def log_encoding():
# if there's no sys.stdin (e.g. console-less GUI), revert to default
return sys.stdin.encoding or 'utf8'
class PlayoffLogger:
@classmethod
def setup(cls, level):
log.basicConfig(
level=level,
format='%(levelname)-8s %(name)-8s %(message)s')
@classmethod
def get(cls, category=''):
return log.getLogger(category)
|