summaryrefslogtreecommitdiffstats
path: root/app/logger.py
blob: 72a2134f47720d2055d234a762868af59cab4552 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import sys
import io

sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')

def log(message):
    print(message, file=sys.stdout, flush=True)

def log_err(message):
    print(message, file=sys.stderr, flush=True)