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

Method closeLogs

logging.go:208–216  ·  view source on GitHub ↗

closeLogs cleans up resources allocated during openLogs. A successful call to openLogs calls this automatically when the context is canceled.

()

Source from the content-addressed store, hash-verified

206// A successful call to openLogs calls this automatically
207// when the context is canceled.
208func (logging *Logging) closeLogs() error {
209 for _, key := range logging.writerKeys {
210 _, err := writers.Delete(key)
211 if err != nil {
212 log.Printf("[ERROR] Closing log writer %v: %v", key, err)
213 }
214 }
215 return nil
216}
217
218// Logger returns a logger that is ready for the module to use.
219func (logging *Logging) Logger(mod Module) *zap.Logger {

Callers 1

openLogsMethod · 0.95

Calls 1

DeleteMethod · 0.45

Tested by

no test coverage detected