go-emlid/reach/client/logger/level.go

20 lines
271 B
Go
Raw Normal View History

2024-08-02 12:57:07 +02:00
package logger
import (
"log/slog"
"github.com/pkg/errors"
)
type Level = slog.Level
func ParseLevel(s string) (Level, error) {
var level Level
if err := level.UnmarshalText([]byte(s)); err != nil {
return level, errors.WithStack(err)
}
return level, nil
}