Skip to content

spanlogger Log should call Error if log level is error #3016

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

Open
cstyan opened this issue Aug 11, 2020 · 0 comments
Open

spanlogger Log should call Error if log level is error #3016

cstyan opened this issue Aug 11, 2020 · 0 comments
Labels
help wanted type/observability To help know what is going on inside Cortex

Comments

@cstyan
Copy link
Contributor

cstyan commented Aug 11, 2020

We use SpanLogger to unify logging and tracing instrumentation code, but we need to call level.Error and log.Error to log and set the error tag on the span in the case of errors. We can keep the current Log and Error functions to satisfy the interfaces but extend Log (or introduce a new function) to detect level=error in the key value pairs passed to the function to also call Error and save users a loc per error handling branch

See discussion starting here: #2970 (comment)

cc @pstibrany @pracucci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted type/observability To help know what is going on inside Cortex
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants