closeLogs cleans up resources allocated during openLogs. A successful call to openLogs calls this automatically when the context is canceled.
()
| 206 | // A successful call to openLogs calls this automatically |
| 207 | // when the context is canceled. |
| 208 | func (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. |
| 219 | func (logging *Logging) Logger(mod Module) *zap.Logger { |