1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 18:37:05 +00:00
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-09 08:39:23 +03:00
parent d17a888dc1
commit fb7627256a

View File

@@ -156,12 +156,12 @@ func sessionHandler(ctx iris.Context) {
}
func fieldsHandler(ctx iris.Context) {
// simulate a heavy job...
start := time.Now()
// simulate a heavy job...
time.Sleep(2 * time.Second)
end := time.Since(start)
// Get the current fields instance and use
// them to it custom log values.
// Get the current fields instance
// and use it to set custom log values.
logFields := accesslog.GetFields(ctx)
logFields.Set("job_latency", end.Round(time.Second))