Documentation ¶
Index ¶
- type Environment
- type HandleType
- type Handler
- type Log
- func (l *Log) Debug(msg string, keyValues ...any)
- func (l *Log) DebugContext(ctx context.Context, msg string, keyValues ...any)
- func (l *Log) Error(msg string, keyValues ...any)
- func (l *Log) ErrorContext(ctx context.Context, msg string, keyValues ...any)
- func (l *Log) Fatal(msg string, keyValues ...any)
- func (l *Log) FatalContext(ctx context.Context, msg string, keyValues ...any)
- func (l *Log) Info(msg string, keyValues ...any)
- func (l *Log) InfoContext(ctx context.Context, msg string, keyValues ...any)
- func (l *Log) Log(ctx context.Context, level slog.Level, msg string, keyValues ...any)
- func (l *Log) Warn(msg string, keyValues ...any)
- func (l *Log) WarnContext(ctx context.Context, msg string, keyValues ...any)
- type Logger
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Environment ¶
type Environment uint8
const ( DEVELOPMENT Environment = iota PRODUCTION RELEASE )
func (Environment) String ¶
func (e Environment) String() string
type HandleType ¶
type HandleType uint8
const ( CONSOLE_HANDLER HandleType = iota TEXT_HANDLER JSON_HANDLER )
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewConsoleHandler ¶
func NewConsoleHandler(opts *slog.HandlerOptions) *Handler
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
func (*Log) DebugContext ¶
func (*Log) ErrorContext ¶
func (*Log) FatalContext ¶
func (*Log) InfoContext ¶
type Logger ¶
type Logger interface { Debug(msg string, args ...any) DebugContext(ctx context.Context, msg string, args ...any) Info(msg string, args ...any) InfoContext(ctx context.Context, msg string, args ...any) Warn(msg string, args ...any) WarnContext(ctx context.Context, msg string, args ...any) Error(msg string, args ...any) ErrorContext(ctx context.Context, msg string, args ...any) Fatal(msg string, args ...any) FatalContext(ctx context.Context, msg string, args ...any) Log(ctx context.Context, level slog.Level, msg string, args ...any) }
type Options ¶
type Options struct { Development bool // Development add development details of machine Debug bool // Debug show debug devel message EnableCaller bool // EnableCaller show caller in line code SkipCaller int // SkipCaller skip caller level of CallerFrames https://github.com/golang/go/issues/59145#issuecomment-1481920720 }
Click to show internal directories.
Click to hide internal directories.