sirupsen/logrus · error

not a valid logrus level %d

Error message

not a valid logrus level %d

What it means

Error "not a valid logrus level %d" thrown in sirupsen/logrus.

Source

Thrown at logrus.go:83

// UnmarshalText implements encoding.TextUnmarshaler.
func (level *Level) UnmarshalText(text []byte) error {
	l, err := parseLevel(text)
	if err != nil {
		return err
	}

	*level = l

	return nil
}

func (level Level) MarshalText() ([]byte, error) {
	switch level {
	case TraceLevel, DebugLevel, InfoLevel, WarnLevel, ErrorLevel, FatalLevel, PanicLevel:
		return []byte(level.String()), nil
	default:
		return nil, fmt.Errorf("not a valid logrus level %d", level)
	}
}

// AllLevels exposing all logging levels.
var AllLevels = []Level{
	PanicLevel,
	FatalLevel,
	ErrorLevel,
	WarnLevel,
	InfoLevel,
	DebugLevel,
	TraceLevel,
}

// These are the different logging levels. You can set the logging level to log
// on your instance of logger, obtained with [logrus.New].
const (
	// PanicLevel level, highest level of severity. Logs and then calls panic with the

View on GitHub (pinned to 457e372460)

When it happens

Trigger: Thrown at logrus.go:83 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sirupsen/logrus@457e372460 (2026-08-16). Data as JSON: /api/errors/8219bc872462c758. Report an issue: GitHub.