Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Using WithError for Warn levels and below behaves weirdly #10

@fizyk

Description

@fizyk

When using WithError alog with Warn and below, the formatter leaves the error key in data, but strips the error message leaving an empty string.

logrus.WithError(errors.New("test")).Warn("Issues!")

{"timestamp":"2009-11-10T23:00:00Z","message":"Issues !","severity":"WARNING","context":{"data":{"error":{}}}}

logrus.WithError(errors.New("test")).Error("Issues!")

{"timestamp":"2009-11-10T23:00:00Z","serviceContext":{},"message":"Issues!: test","severity":"ERROR","context":{"reportLocation":{"filePath":"sandbox634680707/prog.go","lineNumber":21,"functionName":"main"}}}

Console output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions