Skip to content

Commit

Permalink
encoding for logging file handlers (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
msperber committed Jun 13, 2018
1 parent 9c56b09 commit 97ed644
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xnmt/tee.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def set_out_file(out_file):
with open(out_file, mode="w") as f_out:
for line in _preamble_content:
f_out.write(f"{line}\n")
fh = logging.FileHandler(out_file)
fh = logging.FileHandler(out_file, encoding="utf-8")
fh.setLevel(settings.LOG_LEVEL_FILE)
fh.setFormatter(MainFormatter())
logger.addHandler(fh)
yaml_fh = logging.FileHandler(f"{out_file}.yaml", mode='w')
yaml_fh = logging.FileHandler(f"{out_file}.yaml", mode='w', encoding="utf-8")
yaml_fh.setLevel(logging.DEBUG)
yaml_fh.setFormatter(YamlFormatter())
yaml_fh.setLevel(logging.DEBUG)
Expand Down

0 comments on commit 97ed644

Please sign in to comment.