logger

package
v1.0.61 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultFormatter

type DefaultFormatter struct{}

DefaultFormatter is the default formatter

func (*DefaultFormatter) Format

func (f *DefaultFormatter) Format(level Level, timestamp time.Time, message string, fields ...string) string

Format formats the log message

type Formatter

type Formatter interface {
	Format(level Level, timestamp time.Time, message string, fields ...string) string
}

Formatter is the interface for formatting log messages

type Level

type Level int

Level represents the logging level

const (
	Debug Level = iota
	Info
	Warn
	Error
)

type Logger

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

Logger is the main logger struct

func New

func New(level Level) *Logger

New creates a new logger

func (*Logger) Debug

func (l *Logger) Debug(message string, fields ...string)

Debug logs a debug message

func (*Logger) Error

func (l *Logger) Error(message string, fields ...string)

Error logs an error message

func (*Logger) Info

func (l *Logger) Info(message string, fields ...string)

Info logs an info message

func (*Logger) SetLevel

func (l *Logger) SetLevel(level Level)

SetLevel sets the minimum log level

func (*Logger) Warn

func (l *Logger) Warn(message string, fields ...string)

Warn logs a warning message

Jump to

Keyboard shortcuts

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