Skip to content

structured logging: handle unusual keys? #275

Closed
@pohly

Description

@pohly

/kind feature

Describe the solution you'd like

The current design decision is to dump keys as strings without any checks. If those keys contain spaces, line breaks, or other weird characters, then the log output will get messed up.

Presumably this was done for the sake of performance. We should measure the impact of validating keys and substituting unsafe ones. If the overhead is acceptable, we might decide to make the code more robust.

TODO:

  • add test cases with non-string keys (int, bool, struct) to test/output.go with the expected result for the current code, submit PR for discussion
  • decide if and how to enhance the output
  • if we agree on changes, implement those and compare performance of go test -bench=. before and after the changes

Anything else you would like to add:

Brought up in #273 (comment)

/wg structured-logging

Metadata

Metadata

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.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