Skip to content

Commit d752da9

Browse files
authored
Make addCaller a gloabl field (#308)
1 parent 6ff829d commit d752da9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

logp/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type Config struct {
4141
WithFields map[string]any `config:"with_fields" yaml:"with_fields"`
4242

4343
environment Environment
44-
addCaller bool // Adds package and line number info to messages.
44+
AddCaller bool // Adds package and line number info to messages.
4545
development bool // Controls how DPanic behaves.
4646
}
4747

@@ -98,7 +98,7 @@ func DefaultConfig(environment Environment) Config {
9898
Period: 30 * time.Second,
9999
},
100100
environment: environment,
101-
addCaller: true,
101+
AddCaller: true,
102102
}
103103
}
104104

@@ -122,7 +122,7 @@ func DefaultEventConfig(environment Environment) Config {
122122
Enabled: false,
123123
},
124124
environment: environment,
125-
addCaller: true,
125+
AddCaller: true,
126126
}
127127
}
128128

logp/core.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ func DevelopmentSetup(options ...Option) error {
394394
Level: DebugLevel,
395395
ToStderr: true,
396396
development: true,
397-
addCaller: true,
397+
AddCaller: true,
398398
}
399399
for _, apply := range options {
400400
apply(&cfg)
@@ -429,7 +429,7 @@ func Sync() error {
429429

430430
func makeOptions(cfg Config) []zap.Option {
431431
var options []zap.Option
432-
if cfg.addCaller {
432+
if cfg.AddCaller {
433433
options = append(options, zap.AddCaller())
434434
}
435435
if cfg.development {

0 commit comments

Comments
 (0)