log

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: MIT Imports: 8 Imported by: 28

Documentation

Index

Constants

View Source
const TraceLevel = slog.LevelDebug - 10

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, args ...any)

Debug will log a debug info.

func Debugf

func Debugf(msg string, args ...any)

Debug will log a debug info with formatting.

func Error

func Error(msg string, args ...any)

Error will log an error.

func ErrorE

func ErrorE(err error, msg string, args ...any)

Error will log an error for `err`.

func ErrorEf

func ErrorEf(err error, msg string, args ...any)

Error will log an error for `err` with formatting.

func Errorf

func Errorf(msg string, args ...any)

Error will log an error with formatting.

func Info

func Info(msg string, args ...any)

Info will log an info.

func Infof

func Infof(msg string, args ...any)

Info will log an info with formatting.

func IsDebug

func IsDebug() bool

Checks if debug is enabled on the log.

func Panic

func Panic(msg string, args ...any)

Panic will log and panic.

func PanicE

func PanicE(err error, msg string, args ...any)

PanicE will log and panic if `err` is not `nil`.

func PanicEf

func PanicEf(err error, msg string, args ...any)

Panic will log and panic with formatting.

func Panicf

func Panicf(msg string, args ...any)

Panic will log and panic with formatting.

func SetLevel

func SetLevel(level string) error

Sets the log level on the logger.

func Setup

func Setup(level string) error

Setup sets up the default loggers .

func Trace

func Trace(msg string, args ...any)

Trace will log a trace info.

func Tracef

func Tracef(msg string, args ...any)

Trace will log a trace info with formatting.

func Warn

func Warn(msg string, args ...any)

Warn will log an warning info.

func WarnE

func WarnE(err error, msg string, args ...any)

Warn will log a warning for an error `err`.

func WarnEf

func WarnEf(err error, msg string, args ...any)

Warn will log a warning for an error `err` with formatting.

func Warnf

func Warnf(msg string, args ...any)

Warn will log a warning info with formatting.

Types

type ILog

type ILog interface {
	// Trace will log an trace if trace is enabled.
	Trace(msg string, args ...any)
	Tracef(msg string, args ...any)

	// Debug will log an info if debug is enabled.
	Debug(msg string, args ...any)
	Debugf(msg string, args ...any)

	// Info will log an info.
	Info(msg string, args ...any)
	Infof(msg string, args ...any)

	// Warn will log an info.
	Warn(msg string, args ...any)
	Warnf(msg string, args ...any)

	// Warn will log a warning for an error `err`.
	WarnE(err error, msg string, args ...any)

	// Error will log an error.
	Error(msg string, args ...any)
	Errorf(msg string, args ...any)

	// Error will log an error for `err`.
	ErrorE(err error, msg string, args ...any)
	ErrorEf(err error, msg string, args ...any)

	// Panic will log and panic.
	Panic(msg string, args ...any)
	Panicf(msg string, args ...any)

	// PanicE will log and panic if `err` is not `nil`.
	PanicE(err error, msg string, args ...any)
	PanicEf(err error, msg string, args ...any)
}

func NewLoggerST

func NewLoggerST() ILog

NewLoggerST creates a non-threadsafe logger.

Jump to

Keyboard shortcuts

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