make application with base logic

This commit is contained in:
Gitea
2023-11-26 15:39:34 +03:00
parent 0553ea71c3
commit 606b94e35b
32 changed files with 1070 additions and 27 deletions

View File

@ -0,0 +1,27 @@
package sravni
import (
"context"
"fmt"
"log/slog"
)
type restyCtxLogger struct {
ctx context.Context
log *slog.Logger
}
func (l restyCtxLogger) Debugf(format string, v ...any) {
msg := fmt.Sprintf(format, v...)
l.log.DebugContext(l.ctx, msg)
}
func (l restyCtxLogger) Warnf(format string, v ...any) {
msg := fmt.Sprintf(format, v...)
l.log.WarnContext(l.ctx, msg)
}
func (l restyCtxLogger) Errorf(format string, v ...any) {
msg := fmt.Sprintf(format, v...)
l.log.ErrorContext(l.ctx, msg)
}