loguru icon indicating copy to clipboard operation
loguru copied to clipboard

Adding `args`, `kwargs`, and `raw_message` to log records

Open sentrivana opened this issue 6 months ago • 1 comments

Hey, I wanted to explore whether you'd consider adding additional data to log records that get passed to handlers, namely:

  • args
  • kwargs
  • raw_message (or maybe template): the raw, unformatted message before any color formatting or interpolation is applied

Basically, these would just be the args, kwargs and message that the Logger._log function receives, verbatim.

The motivation is that this would allow observability tools to hook into Loguru logs better -- I'm from Sentry and we're currently working on adding logs support to our Loguru integration.

If this sounds ok, I'm happy to PR the change.

sentrivana avatar Jun 05 '25 09:06 sentrivana