clog

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelDebug = Level(slog.LevelDebug)
	LevelInfo  = Level(slog.LevelInfo)
	LevelWarn  = Level(slog.LevelWarn)
	LevelError = Level(slog.LevelError)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CLog added in v0.0.25

type CLog interface {
	AddKeysValuesToCtx(ctx context.Context, kv map[string]interface{}) context.Context
	ErrorCtx(ctx context.Context, err error, msg string, args ...any)
	InfoCtx(ctx context.Context, msg string, args ...any)
	DebugCtx(ctx context.Context, msg string, args ...any)
	WarnCtx(ctx context.Context, msg string, args ...any)
}

type CustomLogger

type CustomLogger struct {
	*slog.Logger
	// contains filtered or unexported fields
}

func NewCustomLogger

func NewCustomLogger(dest io.Writer, level Level, addSource bool) *CustomLogger

func (*CustomLogger) AddKeysValuesToCtx

func (l *CustomLogger) AddKeysValuesToCtx(ctx context.Context, kv map[string]interface{}) context.Context

func (*CustomLogger) DebugCtx added in v0.0.20

func (l *CustomLogger) DebugCtx(ctx context.Context, msg string, args ...any)

DebugCtx logs a debug message with fmt.SprintF()

func (*CustomLogger) ErrorCtx added in v0.0.20

func (l *CustomLogger) ErrorCtx(ctx context.Context, err error, msg string, args ...any)

ErrorCtx logs an error message with fmt.SprintF()

func (*CustomLogger) InfoCtx added in v0.0.20

func (l *CustomLogger) InfoCtx(ctx context.Context, msg string, args ...any)

InfoCtx logs an informational message with fmt.SprintF()

func (*CustomLogger) WarnCtx added in v0.0.20

func (l *CustomLogger) WarnCtx(ctx context.Context, msg string, args ...any)

WarnCtx logs a debug message with fmt.SprintF()

type Level added in v0.0.25

type Level int8

type Stub added in v0.0.25

type Stub struct {
}

func NewCLogStub added in v0.0.25

func NewCLogStub() *Stub

func (*Stub) AddKeysValuesToCtx added in v0.0.25

func (l *Stub) AddKeysValuesToCtx(ctx context.Context, _ map[string]interface{}) context.Context

func (*Stub) DebugCtx added in v0.0.25

func (l *Stub) DebugCtx(_ context.Context, _ string, _ ...any)

func (*Stub) ErrorCtx added in v0.0.25

func (l *Stub) ErrorCtx(_ context.Context, _ error, _ string, _ ...any)

func (*Stub) InfoCtx added in v0.0.25

func (l *Stub) InfoCtx(_ context.Context, _ string, _ ...any)

func (*Stub) WarnCtx added in v0.0.25

func (l *Stub) WarnCtx(_ context.Context, _ string, _ ...any)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL