Skip to content
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

v2 logger #168

Draft
wants to merge 5 commits into
base: seb-metrics
Choose a base branch
from
Draft

v2 logger #168

wants to merge 5 commits into from

Conversation

lavoiesl
Copy link
Contributor

@lavoiesl lavoiesl commented Feb 7, 2023

Significant refactor of the logger package.

Design principles / Motivation

The behaviour added by this package should be available outside of this package (via hooks), but it shouldn't force its registration globally.

New features

  1. Is it now possible to register a Hook on the logrus StandardLogger, such that the field extraction behaviour can be available.
  2. It is now possible to attach a logger on a context, such that the global loggers or the package loggers to not have to be overridden when testing
  3. A DuplicateLogger is now available to facilitate duplicating a logrus.Logger

Breaking changes

  1. Valuer is removed in favour of the ubiquitous context.Context
  2. Remove support for errors.Cause, using errors.Join from go 1.20 instead.

Minor changes

  1. Change log-based tests to use text output where it made sense or otherwise remove them

Copy link

@wperron wperron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

case 1:
return errs[0]
default:
return errors.Join(errs...)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shakes fist at GitHub Actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants