()
| 423 | } |
| 424 | |
| 425 | func (cl *BaseLog) buildOptions() ([]zap.Option, error) { |
| 426 | var options []zap.Option |
| 427 | if cl.WithCaller { |
| 428 | options = append(options, zap.AddCaller()) |
| 429 | if cl.WithCallerSkip != 0 { |
| 430 | options = append(options, zap.AddCallerSkip(cl.WithCallerSkip)) |
| 431 | } |
| 432 | } |
| 433 | if cl.WithStacktrace != "" { |
| 434 | levelEnabler, err := parseLevel(cl.WithStacktrace) |
| 435 | if err != nil { |
| 436 | return options, fmt.Errorf("setting up default Caddy log: %v", err) |
| 437 | } |
| 438 | options = append(options, zap.AddStacktrace(levelEnabler)) |
| 439 | } |
| 440 | return options, nil |
| 441 | } |
| 442 | |
| 443 | // SinkLog configures the default Go standard library |
| 444 | // global logger in the log package. This is necessary because |
no test coverage detected