logger

package
v0.0.0-...-3ccd755 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string, args ...interface{})

Global helper functions

func Error

func Error(format string, args ...interface{})

func Fatal

func Fatal(format string, args ...interface{})

func Info

func Info(format string, args ...interface{})

func SetOutput

func SetOutput(w io.Writer)

SetOutput sets the output destination for the default logger

func Warn

func Warn(format string, args ...interface{})

Types

type LogLevel

type LogLevel int
const (
	DEBUG LogLevel = iota
	INFO
	WARN
	ERROR
	FATAL
)

func (LogLevel) String

func (l LogLevel) String() string

String returns the string representation of the log level

type Logger

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

Logger struct holds the logger instance

func GetLogger

func GetLogger() *Logger

GetLogger returns the default logger instance

func Init

func Init() *Logger

Init initializes the default logger

func NewLogger

func NewLogger() *Logger

NewLogger creates a new logger instance

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

Debug logs debug level messages

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

Error logs error level messages

func (*Logger) Fatal

func (l *Logger) Fatal(format string, args ...interface{})

Fatal logs fatal level messages and exits

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

Info logs info level messages

func (*Logger) SetLevel

func (l *Logger) SetLevel(level LogLevel)

SetLevel sets the minimum logging level

func (*Logger) SetOutput

func (l *Logger) SetOutput(w io.Writer)

SetOutput sets the output destination for the logger

func (*Logger) Warn

func (l *Logger) Warn(format string, args ...interface{})

Warn logs warning level messages

Jump to

Keyboard shortcuts

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