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

Log statement cleanup #1570

Merged
merged 1 commit into from
Jul 6, 2023
Merged

Log statement cleanup #1570

merged 1 commit into from
Jul 6, 2023

Conversation

divergentdave
Copy link
Contributor

This changes a log statement that is currently using the Debug implementation of String, resulting in extra quote marks.

{
  "timestamp": "2023-07-05T19:07:50.771116Z",
  "level": "INFO",
  "fields": {
    "message": "Serving aggregator API relative to DAP API",
    "aggregator_bound_address": "0.0.0.0:80",
    "path_prefix": "\"aggregator-api\""
  },
  "target": "aggregator",
  "filename": "aggregator/src/bin/aggregator.rs",
  "line_number": 89,
  "threadId": "ThreadId(1)"
}

@divergentdave divergentdave requested a review from a team as a code owner July 5, 2023 19:56
Copy link
Contributor

@inahga inahga left a comment

Choose a reason for hiding this comment

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

https://docs.rs/tracing/latest/tracing/#recording-fields

The ? sigil is shorthand that specifies a field should be recorded using its fmt::Debug implementation:

TIL tracing was this sophisticated.

@divergentdave divergentdave merged commit f9d531a into main Jul 6, 2023
6 checks passed
@divergentdave divergentdave deleted the divergentdave-patch-1 branch July 6, 2023 14:05
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.

None yet

2 participants