DefaultLogger returns a Logger instance for an Iris module. If the program contains at least one registered Iris Application before this call then it will return a child of that Application's Logger otherwise a fresh child of the `golog.Default` will be returned instead. It should be used when a mo
(prefix string)
| 215 | // |
| 216 | // It should be used when a module has no access to the Application or its Logger. |
| 217 | func DefaultLogger(prefix string) (logger *golog.Logger) { |
| 218 | if app := LastApplication(); app != nil { |
| 219 | logger = app.Logger() |
| 220 | } else { |
| 221 | logger = golog.Default |
| 222 | } |
| 223 | |
| 224 | logger = logger.Child(prefix) |
| 225 | return |
| 226 | } |
no test coverage detected
searching dependent graphs…