george-maroun / tracecheck

GoLinter to identify improperly formatted logs and make suggestions to fix the logs
MIT License
3 stars 0 forks source link

Add ability to detect keys with variables name containing the string "trace" in WithValues args #9

Closed george-maroun closed 1 year ago

george-maroun commented 1 year ago

add ability to detect keys with variables name containing the string "trace" eg: log := zapr.NewLogger(zap.L()).WithValues(traceLabelKey, traceId.String())

also works with selector. eg: log := zapr.NewLogger(zap.L()).WithValues(telemetry.TraceLogKey, os.Getenv(telemetry.TraceEnvKey))

Although the branch used is issue4/context, this PR is actually linked to issue https://github.com/george-maroun/tracecheck/issues/10