This commit is contained in:
Aditya Siregar
2025-09-01 12:06:14 +07:00
parent 2bdce63852
commit aa662a321f
25 changed files with 2923 additions and 189 deletions
+1
View File
@@ -21,6 +21,7 @@ const (
DeviceOSKey = key("deviceOS")
UserLocaleKey = key("userLocale")
UserRoleKey = key("userRole")
UserNameKey = key("UserName")
)
func LogFields(ctx interface{}) map[string]interface{} {
+2
View File
@@ -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),
}
}