summaryrefslogtreecommitdiff
path: root/jfr_playoff/logger.py
diff options
context:
space:
mode:
authorMichał Klichowicz <emkael@tlen.pl>2024-04-13 13:17:56 +0200
committerMichał Klichowicz <emkael@tlen.pl>2024-04-13 13:17:56 +0200
commit40eaf8435414c6f0a3c7968942b90b5fa85f4d44 (patch)
tree3434b04818020210cc08de3c75a8e16695ee7a66 /jfr_playoff/logger.py
parentf83effb4242a9230b30ec1177bc61bf921b3b45b (diff)
In a console-less setup, e.g. GUI, revert to any sane log encoding
Fixes #55
Diffstat (limited to 'jfr_playoff/logger.py')
-rw-r--r--jfr_playoff/logger.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/jfr_playoff/logger.py b/jfr_playoff/logger.py
index 1218022..3f15c49 100644
--- a/jfr_playoff/logger.py
+++ b/jfr_playoff/logger.py
@@ -1,4 +1,10 @@
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: