log

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 3 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 struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(options ...Option) *Logger

NewLogger creates a new logger with the specified log level and log format. The log level is determined by the LOG_LEVEL environment variable, defaulting to "info". The log format is determined by the LOG_FORMAT environment variable, defaulting to "text".

func (*Logger) Debug

func (log *Logger) Debug(args ...interface{})

func (*Logger) DebugWithFields

func (log *Logger) DebugWithFields(message string, fields ...interface{})

func (*Logger) Error

func (log *Logger) Error(args ...interface{})

func (*Logger) ErrorWithFields

func (log *Logger) ErrorWithFields(message string, fields ...interface{})

func (*Logger) Fatal

func (log *Logger) Fatal(args ...interface{})

func (*Logger) FatalWithFields

func (log *Logger) FatalWithFields(message string, fields ...interface{})

func (*Logger) Info

func (log *Logger) Info(args ...interface{})

func (*Logger) InfoWithFields

func (log *Logger) InfoWithFields(message string, fields ...interface{})

func (*Logger) Panic

func (log *Logger) Panic(args ...interface{})

func (*Logger) PanicWithFields

func (log *Logger) PanicWithFields(message string, fields ...interface{})

func (*Logger) Warn

func (log *Logger) Warn(args ...interface{})

func (*Logger) WarnWithFields

func (log *Logger) WarnWithFields(message string, fields ...interface{})

type Option

type Option func(*Logger)

func WithFormatter

func WithFormatter(formatter logrus.Formatter) Option

WithFormatter configures a logrus logger with the specified formatter

func WithLevel

func WithLevel(level logrus.Level) Option

WithLevel configures a logrus logger with the specified level

Jump to

Keyboard shortcuts

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