aboutsummaryrefslogtreecommitdiffstats
path: root/bot/__init__.py
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2020-11-30 15:38:06 +0100
committerGravatar GitHub <[email protected]>2020-11-30 15:38:06 +0100
commit2b890982510da52f95b518bf79dd9bbe38410d4a (patch)
tree08c3c2f7315be25313ea20abe4b7e404d02d1269 /bot/__init__.py
parentMerge pull request #532 from python-discord/sebastiaan/ci/add-core-dev-approv... (diff)
parentMerge branch 'master' into ks123/advent-of-code (diff)
Merge pull request #531 from python-discord/ks123/advent-of-code
Advent of Code 2020
Diffstat (limited to 'bot/__init__.py')
-rw-r--r--bot/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/__init__.py b/bot/__init__.py
index a9a0865e..bdb18666 100644
--- a/bot/__init__.py
+++ b/bot/__init__.py
@@ -37,7 +37,8 @@ os.makedirs(log_dir, exist_ok=True)
# File handler rotates logs every 5 MB
file_handler = logging.handlers.RotatingFileHandler(
- log_file, maxBytes=5 * (2**20), backupCount=10)
+ log_file, maxBytes=5 * (2**20), backupCount=10, encoding="utf-8",
+)
file_handler.setLevel(logging.TRACE if Client.debug else logging.DEBUG)
# Console handler prints to terminal
@@ -61,7 +62,7 @@ logging.basicConfig(
format='%(asctime)s - %(name)s %(levelname)s: %(message)s',
datefmt="%D %H:%M:%S",
level=logging.TRACE if Client.debug else logging.DEBUG,
- handlers=[console_handler, file_handler]
+ handlers=[console_handler, file_handler],
)
logging.getLogger().info('Logging initialization complete')