schon/evibes/utils/misc.py
Egor fureunoir Gorbunov d07e724934 Features: 1) Add LogLevel Enum to standardize logging levels; 2) Introduce generalized logging utility in VendorManager with Celery runtime context support; 3) Add support for attribute group warnings using the new logging method;
Fixes: 1) Ensure logging conditions are guarded by proper vendor and attribute checks; 2) Correct `__str__` method fallback logic for `VendorManager`;

Extra: 1) Update dependencies including `docutils` to 0.21.2, `psutil` to 7.1.2, and `pip` to >=25.3; 2) Clean up `pyproject.toml` and `uv.lock` with refined version specifications and added new entries; 3) Refactor import statements and remove redundant code; 4) Upgrade Python version to 3.13 in config.
2025-10-25 15:51:25 +03:00

20 lines
452 B
Python

from enum import Enum
from importlib import import_module
from typing import Any
def create_object(module_name: str, class_name: str, *args: list[Any], **kwargs: dict[Any, Any]) -> Any:
module = import_module(module_name)
cls = getattr(module, class_name)
return cls(*args, **kwargs)
class LogLevel(Enum):
DEBUG = "debug"
INFO = "info"
WARNING = "warning"
ERROR = "error"
CRITICAL = "critical"
TRACE = "trace"