Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SetLogLevelCommand commands.AdminCommand = commands.AdminCommand{ Handler: func(ctx context.Context, req *admin.CommandRequest) error { level := req.ValidatorData.(zerolog.Level) zerolog.SetGlobalLevel(level) return nil }, Validator: func(req *admin.CommandRequest) error { level, ok := req.Data["level"] if !ok { return errors.New("the \"level\" field must be provided") } levelStr, ok := level.(string) if !ok { return errors.New("\"level\" must be a string") } logLevel, err := zerolog.ParseLevel(levelStr) if err != nil { return fmt.Errorf("failed to parse level: %w", err) } req.ValidatorData = logLevel return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.