from abc import ABC, abstractmethod
from typing import Any


class MetricsLogger(ABC):
    """Abstract base class for logging metrics."""

    @abstractmethod
    def log_metrics(self, metrics: dict[str, Any], step: int, prefix: str = "") -> None:
        """Log metrics with optional prefix."""

    @abstractmethod
    def close(self) -> None:
        """Cleanup and close the logger."""
