diff options
author | 2021-05-17 12:50:04 -0500 | |
---|---|---|
committer | 2021-05-17 12:50:04 -0500 | |
commit | a174b78114d4204e74e11a820ddf36f00d293112 (patch) | |
tree | 9404dbf50e3f11c7c83b782733aa30d7d15fcae2 /bot/__init__.py | |
parent | Remove comments and update docstrings (diff) | |
parent | Merge pull request #726 from Objectivitix/main (diff) |
Merge branch 'main' into http_status_command_randomness
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. |