1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 11:57:02 +00:00

add TraceRoute feature on request logger

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-08-18 19:33:07 +03:00
parent e98fd21c83
commit 35ab1de212
4 changed files with 16 additions and 1 deletions

View File

@@ -139,6 +139,10 @@ func (l *requestLoggerMiddleware) ServeHTTP(ctx *context.Context) {
} else {
ctx.Application().Logger().Info(line)
}
if l.config.TraceRoute && ctx.GetCurrentRoute() != nil /* it is nil on unhandled error codes */ {
ctx.GetCurrentRoute().Trace(ctx.Application().Logger().Printer)
}
}
// Columnize formats the given arguments as columns and returns the formatted output,