fix: protocol v1
This commit is contained in:
19
reach/client/logger/level.go
Normal file
19
reach/client/logger/level.go
Normal file
@ -0,0 +1,19 @@
|
||||
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
|
||||
}
|
12
reach/client/logger/logger.go
Normal file
12
reach/client/logger/logger.go
Normal file
@ -0,0 +1,12 @@
|
||||
package logger
|
||||
|
||||
import "log/slog"
|
||||
|
||||
var Attr = slog.Any
|
||||
|
||||
type Logger interface {
|
||||
Debug(msg string, args ...any)
|
||||
Info(msg string, args ...any)
|
||||
Warn(msg string, args ...any)
|
||||
Error(msg string, args ...any)
|
||||
}
|
Reference in New Issue
Block a user