Update
This commit is contained in:
@@ -12,7 +12,7 @@ const (
|
||||
CorrelationIDKey = key("CorrelationID")
|
||||
OrganizationIDKey = key("OrganizationIDKey")
|
||||
UserIDKey = key("UserID")
|
||||
OutletIDKey = key("OutletID")
|
||||
DepartmentIDKey = key("DepartmentID")
|
||||
RoleIDKey = key("RoleID")
|
||||
AppVersionKey = key("AppVersion")
|
||||
AppIDKey = key("AppID")
|
||||
@@ -27,7 +27,7 @@ func LogFields(ctx interface{}) map[string]interface{} {
|
||||
fields := make(map[string]interface{})
|
||||
fields[string(CorrelationIDKey)] = value(ctx, CorrelationIDKey)
|
||||
fields[string(OrganizationIDKey)] = value(ctx, OrganizationIDKey)
|
||||
fields[string(OutletIDKey)] = value(ctx, OutletIDKey)
|
||||
fields[string(DepartmentIDKey)] = value(ctx, DepartmentIDKey)
|
||||
fields[string(AppVersionKey)] = value(ctx, AppVersionKey)
|
||||
fields[string(AppIDKey)] = value(ctx, AppIDKey)
|
||||
fields[string(AppTypeKey)] = value(ctx, AppTypeKey)
|
||||
|
||||
@@ -17,17 +17,16 @@ type Logger struct {
|
||||
var log *Logger
|
||||
|
||||
type ContextInfo struct {
|
||||
CorrelationID string
|
||||
UserID uuid.UUID
|
||||
OrganizationID uuid.UUID
|
||||
OutletID uuid.UUID
|
||||
AppVersion string
|
||||
AppID string
|
||||
AppType string
|
||||
Platform string
|
||||
DeviceOS string
|
||||
UserLocale string
|
||||
UserRole string
|
||||
CorrelationID string
|
||||
UserID uuid.UUID
|
||||
DepartmentID uuid.UUID
|
||||
AppVersion string
|
||||
AppID string
|
||||
AppType string
|
||||
Platform string
|
||||
DeviceOS string
|
||||
UserLocale string
|
||||
UserRole string
|
||||
}
|
||||
|
||||
type ctxKeyType struct{}
|
||||
@@ -59,17 +58,16 @@ func NewContext(ctx context.Context, baseFields map[string]interface{}) context.
|
||||
|
||||
func FromGinContext(ctx context.Context) *ContextInfo {
|
||||
return &ContextInfo{
|
||||
CorrelationID: value(ctx, CorrelationIDKey),
|
||||
UserID: uuidValue(ctx, UserIDKey),
|
||||
OutletID: uuidValue(ctx, OutletIDKey),
|
||||
OrganizationID: uuidValue(ctx, OrganizationIDKey),
|
||||
AppVersion: value(ctx, AppVersionKey),
|
||||
AppID: value(ctx, AppIDKey),
|
||||
AppType: value(ctx, AppTypeKey),
|
||||
Platform: value(ctx, PlatformKey),
|
||||
DeviceOS: value(ctx, DeviceOSKey),
|
||||
UserLocale: value(ctx, UserLocaleKey),
|
||||
UserRole: value(ctx, UserRoleKey),
|
||||
CorrelationID: value(ctx, CorrelationIDKey),
|
||||
UserID: uuidValue(ctx, UserIDKey),
|
||||
DepartmentID: uuidValue(ctx, DepartmentIDKey),
|
||||
AppVersion: value(ctx, AppVersionKey),
|
||||
AppID: value(ctx, AppIDKey),
|
||||
AppType: value(ctx, AppTypeKey),
|
||||
Platform: value(ctx, PlatformKey),
|
||||
DeviceOS: value(ctx, DeviceOSKey),
|
||||
UserLocale: value(ctx, UserLocaleKey),
|
||||
UserRole: value(ctx, UserRoleKey),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user