Skip to content

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

Open
@cstyan

Description

@cstyan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions