go-emlid/reach/client/logger/level.go
2024-08-02 12:57:07 +02:00

20 lines
271 B
Go

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
}