MCPcopy
hub / github.com/caddyserver/caddy / buildOptions

Method buildOptions

logging.go:425–441  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

423}
424
425func (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

Callers 3

setupNewDefaultMethod · 0.80
LoggerMethod · 0.80
provisionMethod · 0.80

Calls 1

parseLevelFunction · 0.85

Tested by

no test coverage detected