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

Escape control characters #3250

Open
lilydjwg opened this issue Apr 3, 2025 · 0 comments
Open

Escape control characters #3250

lilydjwg opened this issue Apr 3, 2025 · 0 comments

Comments

@lilydjwg
Copy link

lilydjwg commented Apr 3, 2025

Feature Request

Crates

  • tracing-subscriber

Motivation

Sometimes the string being logged contains control characters (bytes 0..=31). tracing currently outputs them literally, causing:

  • some characters are not visible
  • bell rings (one way or the other)
  • systemd-journald thinks them binary and breaks one log line into multiple records that aren't easy to read

Proposal

When the non-JSON formatter is used, escape control characters inside user-provided event strings.

Alternatives

Let the caller do the escaping. There may be a lot different places to fix across different projects.

See also hickory-dns/hickory-dns#2895.

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

1 participant