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

Fix unknown log file and module #623

Merged
merged 3 commits into from
Jul 19, 2023
Merged

Fix unknown log file and module #623

merged 3 commits into from
Jul 19, 2023

Conversation

Connor1996
Copy link
Member

@Connor1996 Connor1996 commented Jul 19, 2023

Logs are always with unknown file name when redirecting logs to slog, see
截屏2023-07-18 17 56 09

It's because slog would only take static str into account
https://github.com/slog-rs/stdlog/blob/252b6bb6435a8a3ba44748b2e1626aa676508097/lib.rs#L73

With this fix, the file name is not unknown anymore
截屏2023-07-18 17 55 39

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
@Connor1996 Connor1996 requested a review from BusyJay July 19, 2023 01:02
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
@@ -30,9 +30,9 @@ extern "C" fn delegate(c_args: *mut gpr_log_func_args) {
&Record::builder()
.args(format_args!("{msg}"))
.level(level)
.file(file_str.into())
.file_static(file_str.into())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really static?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Connor1996 Connor1996 enabled auto-merge (squash) July 19, 2023 03:11
@Connor1996 Connor1996 merged commit e61834c into tikv:master Jul 19, 2023
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.

3 participants