from __future__ import annotations

import logging

from src.logging import StructuredLoggerAdapter


def test_structured_logger_adapter_prefixes_reserved_record_fields() -> None:
    adapter = StructuredLoggerAdapter(logging.getLogger("test"), extra={})

    _, kwargs = adapter.process(
        "event",
        {
            "message": "detail",
            "name": "overlap",
            "custom": "value",
        },
    )

    assert kwargs["extra"]["log_message"] == "detail"
    assert kwargs["extra"]["log_name"] == "overlap"
    assert kwargs["extra"]["custom"] == "value"
