storage rework

This commit is contained in:
royalcat 2024-06-15 01:14:44 +03:00
parent 06153d61c9
commit e9df8925d1
49 changed files with 1825 additions and 1303 deletions
pkg/rlog

View file

@ -91,6 +91,12 @@ func (l *Logger) With(attrs ...slog.Attr) *Logger {
}
}
// returns a new slog logger with the same attribures as the original logger
// TODO currently not logging function name
func (l *Logger) Slog() *slog.Logger {
return slog.New(l.handler)
}
const endpointKey = "endpoint"
func (l *Logger) WithEndpoint(name string) *Logger {
@ -126,9 +132,9 @@ func errValue(err error) slog.Value {
return slog.GroupValue(groupValues...)
}
func Component(name string) *Logger {
func Component(name ...string) *Logger {
return &Logger{
handler: handler,
component: []string{name},
component: name,
}
}