The following demo program prints two matching log entries:
package main
import (
"os"
"github.com/blendle/zapdriver"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
func main() {
consoleEncoder := zapcore.NewConsoleEncoder(zap.NewDevelopmentEncoderConfig())
core := zapcore.NewTee(
zapcore.NewCore(consoleEncoder, os.Stderr, zapcore.ErrorLevel),
zapcore.NewCore(consoleEncoder, os.Stdout, zapcore.InfoLevel),
)
logger := zap.New(core, zap.AddCaller())
logger = logger.WithOptions(zapdriver.WrapCore())
defer logger.Sync()
logger.Info("Starting...")
}
I am actually not sure this can be fixed or simply this is a limitation of Zap, but it seems to me that Check simply cannot work properly in this case without calling Check on the underlying core. Will investigate the issue further...
The following demo program prints two matching log entries:
I am actually not sure this can be fixed or simply this is a limitation of Zap, but it seems to me that
Checksimply cannot work properly in this case without callingCheckon the underlying core. Will investigate the issue further...