Update
This commit is contained in:
@@ -21,6 +21,7 @@ const (
|
||||
DeviceOSKey = key("deviceOS")
|
||||
UserLocaleKey = key("userLocale")
|
||||
UserRoleKey = key("userRole")
|
||||
UserNameKey = key("UserName")
|
||||
)
|
||||
|
||||
func LogFields(ctx interface{}) map[string]interface{} {
|
||||
|
||||
@@ -27,6 +27,7 @@ type ContextInfo struct {
|
||||
DeviceOS string
|
||||
UserLocale string
|
||||
UserRole string
|
||||
UserName string
|
||||
}
|
||||
|
||||
type ctxKeyType struct{}
|
||||
@@ -68,6 +69,7 @@ func FromGinContext(ctx context.Context) *ContextInfo {
|
||||
DeviceOS: value(ctx, DeviceOSKey),
|
||||
UserLocale: value(ctx, UserLocaleKey),
|
||||
UserRole: value(ctx, UserRoleKey),
|
||||
UserName: value(ctx, UserNameKey),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user