MCPcopy Create free account
hub / github.com/kataras/iris / DefaultLogger

Function DefaultLogger

context/application.go:217–226  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

215//
216// It should be used when a module has no access to the Application or its Logger.
217func 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}

Callers 2

ValidateMethod · 0.92
NewFunction · 0.92

Calls 2

LastApplicationFunction · 0.85
LoggerMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…