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.
With the current behavior of
@traced, the log message produced when entering or exiting a traced function uses the format specifier%rto 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.pformatfor large dicts,lambda x: json.dumps(json.loads(x), indent=2)for long single-line JSON strings, etc.