diff options
author | Michał Klichowicz <emkael@tlen.pl> | 2024-04-13 13:17:56 +0200 |
---|---|---|
committer | Michał Klichowicz <emkael@tlen.pl> | 2024-04-13 13:17:56 +0200 |
commit | 40eaf8435414c6f0a3c7968942b90b5fa85f4d44 (patch) | |
tree | 3434b04818020210cc08de3c75a8e16695ee7a66 /jfr_playoff/logger.py | |
parent | f83effb4242a9230b30ec1177bc61bf921b3b45b (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.py | 6 |
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: |