logger

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.9.0

func New(progress string, logOpts slog.HandlerOptions) slog.Handler

func NewPrettyLog added in v0.9.0

func NewPrettyLog(progress string, logOpts slog.HandlerOptions) slog.Handler

func NewRootLog added in v0.9.0

func NewRootLog(logOpts slog.HandlerOptions) slog.Handler

func NewSimpleLog added in v0.9.0

func NewSimpleLog(out io.Writer, level slog.Leveler) slog.Handler

Types

type LogAggregator

type LogAggregator struct {
	// contains filtered or unexported fields
}

func GetLogAggregator

func GetLogAggregator() *LogAggregator

func NewLogAggregator

func NewLogAggregator(format string) *LogAggregator

GetLogAggregator returns the singleton instance of LogAggregator.

func (*LogAggregator) Copy added in v0.9.0

func (la *LogAggregator) Copy(r io.ReadCloser) (n int, err error)

func (*LogAggregator) FailedMessage

func (la *LogAggregator) FailedMessage(routineID string, msg string)

func (*LogAggregator) Flush

func (la *LogAggregator) Flush()

Flush will close the log channel and wait for all messages to be processed.

func (*LogAggregator) LogMessage

func (la *LogAggregator) LogMessage(routineID string, msg string)

func (*LogAggregator) SuccessMessage

func (la *LogAggregator) SuccessMessage(routineID string, msg string)

func (*LogAggregator) Write added in v0.9.0

func (la *LogAggregator) Write(p []byte) (n int, err error)

type LogEntry

type LogEntry struct {
	// contains filtered or unexported fields
}

type LogMessage

type LogMessage struct {
	// contains filtered or unexported fields
}

type Options added in v0.9.0

type Options struct {
	Level slog.Leveler
}

type ResettableOnce

type ResettableOnce struct {
	// contains filtered or unexported fields
}

func (*ResettableOnce) Do

func (ro *ResettableOnce) Do(f func())

func (*ResettableOnce) Reset

func (ro *ResettableOnce) Reset()

type SimpleHandler added in v0.9.0

type SimpleHandler struct {
	// contains filtered or unexported fields
}

func (*SimpleHandler) Enabled added in v0.9.0

func (h *SimpleHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*SimpleHandler) Handle added in v0.9.0

func (h *SimpleHandler) Handle(ctx context.Context, r slog.Record) error

func (*SimpleHandler) WithAttrs added in v0.9.0

func (h *SimpleHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*SimpleHandler) WithGroup added in v0.9.0

func (h *SimpleHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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