#1482·loguru

Record type bug

Author: triple-razeCreated Jun 22, 2026Updated Aug 23, 2026
Labelsenhancement
python
from loguru import Record

def func(record: Record) -> None:
    print(record)  # using in any function, forcing mypy to do typecheck
mypy: Expression type contains "Any" (has type "Record")

its because of

python
class Record(TypedDict):
    elapsed: timedelta
    exception: Optional[RecordException]
    # \/\/\/\/\/\/\/\/\/\/
    extra: Dict[Any, Any]
    # /\/\/\/\/\/\/\/\/\/\ 
    file: RecordFile
    function: str
    level: RecordLevel
    line: int
    message: str
    module: str
    name: Optional[str]
    process: RecordProcess
    thread: RecordThread
    time: datetime

maybe separate Record and Record with context or something like that?