Skip to content

logfire-api instrument decorator behaves wrong #1877

@alexmojaki

Description

@alexmojaki

🚩 *logfire-api shim uses args to accept positional func arg but silently replaces it with decorator

In the logfire-api no-op shim, instrument(self, *args, _level=None, **kwargs) always returns decorator (which takes a func and returns it). When used as @logfire.instrument (without parens), instrument(func) returns decorator rather than decorator(func), so my_func becomes decorator — a function that takes one arg and returns it, rather than the original function. This is a pre-existing issue in the logfire-api shim (not introduced by this PR), and is unlikely to matter in practice since the shim is only used when logfire is not installed.

(Refers to lines 134-138)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Originally posted by @devin-ai-integration[bot] in #1871

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions