Skip to content

structured logging: better support for multi-line strings #106262

@pohly

Description

@pohly

What would you like to be added?

When using InfoS or ErrorS with a key/value that has a multi-line string as value, that value will appear as quoted string in the log message, i.e. the log message will still be a single line.

It would be nicer to print the value in text mode so that it goes across multiple lines, with clear indicators for start and end of the value. Indention could be used to avoid mistaking some embedded line as the start of a new log message.

In JSON mode, the value should be formatted normally.

/sig instrumentation
/wg structured-logging

Why is this needed?

Always printing as a single line can can make the log output unreadable (#104868).

Metadata

Metadata

Assignees

Labels

area/loggingkind/featureCategorizes issue or PR as related to a new feature.priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.sig/instrumentationCategorizes an issue or PR as relevant to SIG Instrumentation.triage/acceptedIndicates an issue or PR is ready to be actively worked on.wg/structured-loggingCategorizes an issue or PR as relevant to WG Structured Logging.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions