Skip to content
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

May Return Absolute File Paths in Logs Under Certain Conditions? #649

Closed
Dynasty-CS opened this issue Dec 9, 2024 · 2 comments
Closed

Comments

@Dynasty-CS
Copy link

Dynasty-CS commented Dec 9, 2024

c9e5e13
While using the #[track_caller] attribute with the following function:

#[track_caller]
pub fn loc() -> &'static Location<'static> {
Location::caller()
}

it seems that in some cases, the log outputs might include absolute file paths instead of relative paths.

@Thomasdezeeuw
Copy link
Collaborator

This is controlled by rustc, not the log crate, I don't think we can do much here.

I think rustc has some options here, e.g. --remap-path-prefix or rust-lang/rust#111540.

@Dynasty-CS
Copy link
Author

Oh thank you a lot

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

No branches or pull requests

2 participants