From 0a1b57323d66546bbce83911fa7363aa4c06687f Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Mon, 27 Nov 2023 13:16:46 +0100 Subject: [PATCH] fix build --- zap.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zap.go b/zap.go index 4ce6ba6..60ef297 100644 --- a/zap.go +++ b/zap.go @@ -89,7 +89,12 @@ func GinzapWithConfig(logger ZapLogger, conf *Config) gin.HandlerFunc { logger.Error(e, fields...) } } else { - logger.Log(conf.DefaultLevel, path, fields...) + zl, ok := logger.(*zap.Logger) + if ok { + zl.Log(conf.DefaultLevel, path, fields...) + } else { + logger.Error(path, fields...) + } } } }