logger

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 3 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.1.0

type Config struct {
	Development    bool   `json:"development"`
	LogFile        string `json:"log_file"`
	CallerSkip     int    `json:"caller_skip"`
	DisableConsole bool   `json:"disable_console"`
}

func (*Config) Clone added in v0.6.0

func (c *Config) Clone() *Config

type LogContext added in v0.1.0

type LogContext = map[string]any

type Logger

type Logger interface {
	Info(...any)
	Infof(string, ...any)
	Error(...any)
	Errorf(string, ...any)
	Debug(...any)
	Fatal(...any)
	Warn(...any)
	Panic(...any)
	DPanic(...any)
	WithContext(context LogContext, callerSkips ...int) Logger
}

type MockLogger added in v0.1.0

type MockLogger struct {
	Silence  bool
	Messages []*MockLoggerMessage
	// contains filtered or unexported fields
}

func CreateMockLogger added in v0.1.0

func CreateMockLogger(silences ...bool) *MockLogger

func (*MockLogger) DPanic added in v0.1.0

func (l *MockLogger) DPanic(params ...any)

func (*MockLogger) Debug added in v0.1.0

func (l *MockLogger) Debug(params ...any)

func (*MockLogger) Error added in v0.1.0

func (l *MockLogger) Error(params ...any)

func (*MockLogger) Errorf added in v0.1.0

func (l *MockLogger) Errorf(msg string, params ...any)

func (*MockLogger) Fatal added in v0.1.0

func (l *MockLogger) Fatal(params ...any)

func (*MockLogger) Info added in v0.1.0

func (l *MockLogger) Info(params ...any)

func (*MockLogger) Infof added in v0.1.0

func (l *MockLogger) Infof(msg string, params ...any)

func (*MockLogger) Last added in v0.1.0

func (l *MockLogger) Last() MockLoggerMessage

func (*MockLogger) Panic added in v0.1.0

func (l *MockLogger) Panic(params ...any)

func (*MockLogger) Warn added in v0.1.0

func (l *MockLogger) Warn(params ...any)

func (*MockLogger) WithContext added in v0.1.0

func (l *MockLogger) WithContext(context LogContext, callerSkips ...int) Logger

type MockLoggerMessage added in v0.1.0

type MockLoggerMessage struct {
	Type   string `json:"type"`
	Params []any  `json:"params"`
}

func (MockLoggerMessage) String added in v0.1.0

func (m MockLoggerMessage) String() string

Jump to

Keyboard shortcuts

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