-
Notifications
You must be signed in to change notification settings - Fork 13
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
refactor recent changes to martian logging #396
Conversation
internal/martian/log/log.go
Outdated
if v := ctx.Value(TraceContextKey); v != nil { | ||
format = fmt.Sprintf("[%s] %s", v, format) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is repeated 3 times, maybe extract that to function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
This probably can be squashed martian(handler): use context logging functions Hubert Grochowski Yesterday 16:30 |
I suggest to move the cutting of martian log prefix to martian log functions instead of doing cmd/forarder/run: apply more advanced logic to cut |
This allows use to print logs with trace id.
Logs in these files does not need to be traced.
Since martian logger appends trace id to the format this in an easy patch to make the log line look ok. [proxy] DEBUG: [18a6b0c67a1] msg -> [proxy] [DEBUG] [18a6b0c67a1] msg
This makes the logs more flexible as one can add any prefix by Deocrate function in logger.
The martian prefix has been removed from the log lines for good. It is no longer needed to decorate the logs.
Fixes #394
Example log message: