diff options
| author | 2021-05-16 15:50:07 -0400 | |
|---|---|---|
| committer | 2021-05-16 15:50:07 -0400 | |
| commit | 07b5f296bed099d4cde849cfeba3320e3f4aa808 (patch) | |
| tree | 87b8efa0a3d11d38eb0f77c75e4a42d5033584b9 /bot/__init__.py | |
| parent | delete trailing whitespace after docstring (diff) | |
| parent | Merge pull request #738 from python-discord/vcokltfre/feat/bookmark-reply (diff) | |
Merge branch 'main' into main
Diffstat (limited to 'bot/__init__.py')
| -rw-r--r-- | bot/__init__.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bot/__init__.py b/bot/__init__.py index 71b7c8a3..85ae4758 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -1,3 +1,10 @@ +try: + from dotenv import load_dotenv + print("Found .env file, loading environment variables from it.") + load_dotenv(override=True) +except ModuleNotFoundError: + pass + import asyncio import logging import logging.handlers @@ -64,12 +71,12 @@ logging.getLogger("matplotlib").setLevel(logging.ERROR) # Setup new logging configuration logging.basicConfig( - format='%(asctime)s - %(name)s %(levelname)s: %(message)s', + 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], ) -logging.getLogger().info('Logging initialization complete') +logging.getLogger().info("Logging initialization complete") # On Windows, the selector event loop is required for aiodns. |