Record type bug
Author: triple-razeCreated Jun 22, 2026Updated Aug 23, 2026
Labelsenhancement
from loguru import Record
def func(record: Record) -> None:
print(record) # using in any function, forcing mypy to do typecheckmypy: Expression type contains "Any" (has type "Record")its because of
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: datetimemaybe separate Record and Record with context or something like that?
Source: Delgan/loguru