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

Fix copying stack setting in logger's Output method #325

Merged
merged 1 commit into from
Jun 7, 2021
Merged

Commits on Jun 7, 2021

  1. Fix copying stack setting in logger's Output method

    Minimum example to reproduce the problem:
    ```go
    package main
    
    import (
    	"os"
    
    	"github.com/pkg/errors"
    	"github.com/rs/zerolog"
    	"github.com/rs/zerolog/log"
    	"github.com/rs/zerolog/pkgerrors"
    )
    
    func main() {
    	log.Logger = log.With().Caller().Stack().Logger().Output(zerolog.ConsoleWriter{Out: os.Stderr})
    	zerolog.ErrorStackMarshaler = pkgerrors.MarshalStack
    
    	log.Info().Err(errors.New("test")).Send()
    }
    ```
    Without my changes `stack` isn't printed.
    adw1n committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    af243b5 View commit details
    Browse the repository at this point in the history