Skip to content

Feature request: allow custom format function for args/kwargs in @traced #18

Description

@kini

With the current behavior of @traced, the log message produced when entering or exiting a traced function uses the format specifier %r to print the args/kwargs inputs to the function and the return value of the function. It would be nice if we could provide our own custom formatter function to use when displaying these values, e.g. pprint.pformat for large dicts, lambda x: json.dumps(json.loads(x), indent=2) for long single-line JSON strings, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions