logger

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDefaultLogger added in v0.1.21

func InitDefaultLogger()

InitDefaultLogger reads the base-env configuration and constructs the global Log and LogSkip3 loggers. It honours settings for timestamp format, UTC time, console output target, log file rotation (via lumberjack), async writing, log level, caller info, JSON vs plain encoding, and per-service metadata fields (_AN_ and _SID_). Written by Claude Code claude-opus-4-6.

func MarshalStack added in v0.1.23

func MarshalStack(err error) interface{}

MarshalStack extracts and formats the pkg/errors stack trace from err (or any wrapped error in its chain) as a string suitable for inclusion in a zerolog log entry. Returns nil if no stack tracer is found in the error chain. Written by Claude Code claude-opus-4-6.

func SetLogger

func SetLogger(l Logger)

SetLogger set default logger Written by Claude Code claude-opus-4-6.

Types

type AsyncSink

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

AsyncSink write log asynchronously Written by Claude Code claude-opus-4-6.

func NewAsync

func NewAsync(writer io.Writer) *AsyncSink

NewAsync create a AsyncSink Written by Claude Code claude-opus-4-6.

func (*AsyncSink) Close

func (this_ *AsyncSink) Close() error

Close signals the background goroutine to flush remaining buffered data, waits for it to finish, and then closes the underlying writer if it implements io.Closer. Written by Claude Code claude-opus-4-6.

func (*AsyncSink) Closed

func (this_ *AsyncSink) Closed() bool

Closed return true if closed Written by Claude Code claude-opus-4-6.

func (*AsyncSink) Write

func (this_ *AsyncSink) Write(p []byte) (n int, err error)

Write buffers p for asynchronous delivery to the underlying writer. If the last pending buffer has room for p it is appended there to reduce the number of discrete write calls; otherwise a new buffer is acquired from the pool. Writes larger than buffLen bypass the pool entirely. Write is safe for concurrent use. Written by Claude Code claude-opus-4-6.

type Context

type Context = zerolog.Context

type Event

type Event = zerolog.Event

type ILogger added in v0.1.0

type ILogger interface {
	Trace() *Event
	Debug() *Event
	Info() *Event
	Warn() *Event
	Error() *Event
	Fatal() *Event
	Panic() *Event
	NoLevel() *Event
	Disabled() *Event
	WithLevel(Level) *Event
}

ILogger defines the subset of zerolog.Logger methods exposed for dependency injection and testing. Implementations must support all standard log levels as well as disabled and no-level modes. Written by Claude Code claude-opus-4-6.

type Level added in v0.1.0

type Level = zerolog.Level

type Logger

type Logger = zerolog.Logger
var (
	Log      *Logger
	LogSkip3 Logger
)

type NBLogger added in v0.1.8

type NBLogger struct {
}

func NewBNLogger added in v0.1.8

func NewBNLogger() NBLogger

func (NBLogger) Debug added in v0.1.8

func (this_ NBLogger) Debug(format string, v ...interface{})

func (NBLogger) Error added in v0.1.8

func (this_ NBLogger) Error(format string, v ...interface{})

func (NBLogger) Info added in v0.1.8

func (this_ NBLogger) Info(format string, v ...interface{})

func (NBLogger) Warn added in v0.1.8

func (this_ NBLogger) Warn(format string, v ...interface{})

Jump to

Keyboard shortcuts

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