Skip to content

Commit

Permalink
utf-8 で
Browse files Browse the repository at this point in the history
  • Loading branch information
duri0214 committed Aug 9, 2023
1 parent 2d3b4f3 commit 265654b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mysite/vietnam_research/domain/service/logservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self, log_file_name: str = './generic.log'):
"""
self.logger = logging.getLogger(__name__)
self.logger.setLevel(logging.INFO)
file_handler = logging.FileHandler(log_file_name)
file_handler = logging.FileHandler(log_file_name, encoding='utf-8')
file_handler.setFormatter(logging.Formatter(self._format))
self.logger.addHandler(file_handler)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_write(self):

with open(log_path) as f:
stream_in_log1 = f.read()
log.write('abc')
log.write('abc日本語も大丈夫')
with open(log_path) as f:
stream_in_log2 = f.read()

Expand Down

0 comments on commit 265654b

Please sign in to comment.