Spaces:
Runtime error
Runtime error
Upload __init__.py
Browse files
financial_bot/__init__.py
CHANGED
|
@@ -3,12 +3,12 @@ import logging.config
|
|
| 3 |
from pathlib import Path
|
| 4 |
|
| 5 |
import yaml
|
| 6 |
-
from dotenv import find_dotenv, load_dotenv
|
| 7 |
|
| 8 |
logger = logging.getLogger(__name__)
|
| 9 |
|
| 10 |
|
| 11 |
-
def initialize(logging_config_path: str = "logging.yaml"
|
| 12 |
"""
|
| 13 |
Initializes the logger and environment variables.
|
| 14 |
|
|
@@ -26,6 +26,7 @@ def initialize(logging_config_path: str = "logging.yaml", env_file_path: str = "
|
|
| 26 |
)
|
| 27 |
logging.basicConfig(level=logging.INFO)
|
| 28 |
|
|
|
|
| 29 |
logger.info("Initializing env vars...")
|
| 30 |
if env_file_path is None:
|
| 31 |
env_file_path = find_dotenv(raise_error_if_not_found=True, usecwd=False)
|
|
@@ -34,7 +35,7 @@ def initialize(logging_config_path: str = "logging.yaml", env_file_path: str = "
|
|
| 34 |
found_env_file = load_dotenv(env_file_path, verbose=True, override=True)
|
| 35 |
if found_env_file is False:
|
| 36 |
raise RuntimeError(f"Could not find environment file at: {env_file_path}")
|
| 37 |
-
|
| 38 |
|
| 39 |
def initialize_logger(
|
| 40 |
config_path: str = "logging.yaml", logs_dir_name: str = "logs"
|
|
|
|
| 3 |
from pathlib import Path
|
| 4 |
|
| 5 |
import yaml
|
| 6 |
+
# from dotenv import find_dotenv, load_dotenv
|
| 7 |
|
| 8 |
logger = logging.getLogger(__name__)
|
| 9 |
|
| 10 |
|
| 11 |
+
def initialize(logging_config_path: str = "logging.yaml"):
|
| 12 |
"""
|
| 13 |
Initializes the logger and environment variables.
|
| 14 |
|
|
|
|
| 26 |
)
|
| 27 |
logging.basicConfig(level=logging.INFO)
|
| 28 |
|
| 29 |
+
```
|
| 30 |
logger.info("Initializing env vars...")
|
| 31 |
if env_file_path is None:
|
| 32 |
env_file_path = find_dotenv(raise_error_if_not_found=True, usecwd=False)
|
|
|
|
| 35 |
found_env_file = load_dotenv(env_file_path, verbose=True, override=True)
|
| 36 |
if found_env_file is False:
|
| 37 |
raise RuntimeError(f"Could not find environment file at: {env_file_path}")
|
| 38 |
+
```
|
| 39 |
|
| 40 |
def initialize_logger(
|
| 41 |
config_path: str = "logging.yaml", logs_dir_name: str = "logs"
|