logging

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	// Debug logs at debug level
	Debug(msg string, args ...interface{})

	// Info logs at info level
	Info(msg string, args ...interface{})

	// Warn logs at warn level
	Warn(msg string, args ...interface{})

	// Error logs at error level
	Error(msg string, args ...interface{})

	// Fatal logs at fatal level and exits
	Fatal(msg string, args ...interface{})

	// With returns a logger with additional context
	With(args ...interface{}) Logger

	// WithContext returns a logger with additional context
	WithContext(key string, value interface{}) Logger
}

Logger defines the logging interface

func NewLogger added in v0.1.1

func NewLogger(name string) Logger

NewLogger creates a new logger

func NewLoggerWithOutput added in v0.1.1

func NewLoggerWithOutput(name string, w io.Writer) Logger

NewLoggerWithOutput creates a new logger with custom output

type NoLog

type NoLog struct{}

NoLog is a logger that doesn't log anything

func (NoLog) Debug

func (NoLog) Debug(string, ...interface{})

Debug implements Logger

func (NoLog) Error

func (NoLog) Error(string, ...interface{})

Error implements Logger

func (NoLog) Fatal

func (NoLog) Fatal(string, ...interface{})

Fatal implements Logger

func (NoLog) Info

func (NoLog) Info(string, ...interface{})

Info implements Logger

func (NoLog) Warn

func (NoLog) Warn(string, ...interface{})

Warn implements Logger

func (NoLog) With added in v0.1.1

func (n NoLog) With(...interface{}) Logger

With implements Logger

func (NoLog) WithContext added in v0.1.1

func (n NoLog) WithContext(string, interface{}) Logger

WithContext implements Logger

Jump to

Keyboard shortcuts

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