Skip to content

ref(logging): make traced_with_gil display callsite filename and lineno #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

john-z-yang
Copy link
Member

@john-z-yang john-z-yang commented Jun 19, 2025

Refactor traced_with_gil into a macro so it automatically adds file, lineno, and columno of the callsite into the label.

Before

traced_with_gil("test_build_map", |py| {
    ...
})
[ThreadId(2)] Function [test_build_map] Took 116.25µs to acquire GIL

Now

traced_with_gil!(|py| {
    ...
})
src/transformer.rs:226:9 with ThreadId(2) took 103.458µs to acquire GIL

@john-z-yang john-z-yang force-pushed the john/trace-with-lineno branch 2 times, most recently from 761b374 to c717dec Compare June 19, 2025 03:04
@john-z-yang john-z-yang force-pushed the john/trace-with-lineno branch from c717dec to e48b085 Compare June 19, 2025 03:13
@john-z-yang john-z-yang marked this pull request as ready for review June 19, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant