Skip to content

Commit aad2c0e

Browse files
authored
Skip one caller to show the correct file/line that issued the log (#325)
1 parent b06f9b2 commit aad2c0e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

logp/logger.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ func NewProductionLogger(selector string, options ...LogOption) (*Logger, error)
7171

7272
// NewDevelopmentLogger returns a development suitable logp.Logger
7373
func NewDevelopmentLogger(selector string, options ...LogOption) (*Logger, error) {
74+
options = append([]LogOption{zap.AddCallerSkip(1)}, options...)
7475
log, err := zap.NewDevelopment(options...)
7576
log = log.Named(selector)
7677
if err != nil {

0 commit comments

Comments
 (0)