Skip to content

Adding args, kwargs, and raw_message to log records #1349

@sentrivana

Description

@sentrivana

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureRequest for adding a new feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions