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

Retain source location from log crate if they are &'static #23

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

SpriteOvO
Copy link
Owner

Fixes #22.

The problem is that the source location from the log crate is an internal type MaybeStaticStr<'a> which is like a Cow<'static, str>, so that means they are possible to be runtime &'a str instead of &'static str.

I had left a None for the source_location inside the proxy since we store location information as &'static str so there is no way to store runtime &'a str in it unless we change the API.

But reconsider the situation, most crates only use the logging macros from log crate instead of constructing something manually, and source location from macros should always be &'static str, So we can safely ignore those &'a str cases, which should not be a big problem.

@SpriteOvO SpriteOvO changed the base branch from main to main-dev February 6, 2023 06:35
@SpriteOvO SpriteOvO merged commit c3435e2 into main-dev Feb 6, 2023
@SpriteOvO SpriteOvO deleted the fix-log-crate-srcloc branch February 6, 2023 17:47
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.

[Bug Report] Source data is not displayed when using log crate
1 participant