mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-22 01:12:16 +08:00
pass context Keys to LogFormatterParams
This commit is contained in:
parent
59500f7c36
commit
1be9ccae8e
@ -66,8 +66,8 @@ type LogFormatterParams struct {
|
|||||||
IsTerm bool
|
IsTerm bool
|
||||||
// BodySize is the size of the Response Body
|
// BodySize is the size of the Response Body
|
||||||
BodySize int
|
BodySize int
|
||||||
// Context is the Context associated with the request.
|
// Keys are the keys set on the request's context.
|
||||||
Context *Context
|
Keys map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// StatusCodeColor is the ANSI color for appropriately logging http status code to a terminal.
|
// StatusCodeColor is the ANSI color for appropriately logging http status code to a terminal.
|
||||||
@ -229,7 +229,7 @@ func LoggerWithConfig(conf LoggerConfig) HandlerFunc {
|
|||||||
param := LogFormatterParams{
|
param := LogFormatterParams{
|
||||||
Request: c.Request,
|
Request: c.Request,
|
||||||
IsTerm: isTerm,
|
IsTerm: isTerm,
|
||||||
Context: c,
|
Keys: c.Keys,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop timer
|
// Stop timer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user