|
|
import os |
|
|
from pathlib import Path |
|
|
from typing import Optional |
|
|
|
|
|
class Config: |
|
|
"""Application configuration.""" |
|
|
|
|
|
|
|
|
HUGGINGFACE_TOKEN: Optional[str] = os.getenv("HUGGINGFACE_TOKEN") |
|
|
|
|
|
|
|
|
LOG_LEVEL: str = os.getenv("LOG_LEVEL", "INFO") |
|
|
ENABLE_VERBATIM_LOGS: bool = os.getenv("ENABLE_VERBATIM_LOGS", "true").lower() == "true" |
|
|
|
|
|
|
|
|
BASE_DIR = Path(__file__).parent.parent.parent |
|
|
VERBATIM_LOG_PATH = BASE_DIR / os.getenv("VERBATIM_LOG_PATH", "logs/verbatim") |
|
|
REDACTED_LOG_PATH = BASE_DIR / os.getenv("REDACTED_LOG_PATH", "logs/redacted") |
|
|
|
|
|
@classmethod |
|
|
def ensure_log_dirs(cls): |
|
|
"""Create log directories if they don't exist.""" |
|
|
cls.VERBATIM_LOG_PATH.mkdir(parents=True, exist_ok=True) |
|
|
cls.REDACTED_LOG_PATH.mkdir(parents=True, exist_ok=True) |
|
|
|
|
|
config = Config() |
|
|
config.ensure_log_dirs() |
|
|
|