Skip to content

Support for log level specification in the instrument decorator #1452

@Ben-Giant-VC

Description

@Ben-Giant-VC

Description

It would be great if the logfire.instrument decorator supported the _level argument in the same way that logfire.span does.

ie the below should behave the same

`
import logfire

@logfire.instrument('Running foo', _level='debug')
def foo_1():
logfire.debug('Inside foo 1')

def foo_2():
with logfire.span('Running foo', _level='debug'):
logfire.debug('Inside foo 2')

if name == "main":
foo_1()
foo_2()
`

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions