logger

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaultLevel

func SetDefaultLevel(level string)

SetDefaultLevel sets the level of the default logger

Types

type Level

type Level int

Level represents a logging level

const (
	// Debug level for detailed debugging information
	Debug Level = iota
	// Info level for general operational information
	Info
	// Warn level for warning messages that might indicate problems
	Warn
	// Error level for error messages
	Error
)

type Logger

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

Logger represents a structured logger

func New

func New(level string, prefix string) *Logger

New creates a new logger with the specified level and prefix

func (*Logger) Debug

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

Debug logs a debug message

func (*Logger) Error

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

Error logs an error message

func (*Logger) Info

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

Info logs an info message

func (*Logger) SetLevel

func (l *Logger) SetLevel(level string)

SetLevel sets the logging level

func (*Logger) SetOutput

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

SetOutput sets the output writer

func (*Logger) Warn

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

Warn logs a warning message

Jump to

Keyboard shortcuts

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