log

package
v0.48.0-dev2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package log provides a high-performance, non-blocking logger for userspace networking

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level uint32
const (
	LevelPanic Level = iota
	LevelFatal
	LevelError
	LevelWarn
	LevelInfo
	LevelDebug
	LevelTrace
)

type Logger

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

Logger is a high-performance, non-blocking logger

func NewFromLogrus

func NewFromLogrus(logrusLogger *log.Logger) *Logger

NewFromLogrus creates a new Logger that writes to the same output as the given logrus logger

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...any)

Debug logs a message at debug level

func (*Logger) Error

func (l *Logger) Error(format string, args ...any)

Error logs a message at error level

func (*Logger) Info

func (l *Logger) Info(format string, args ...any)

Info logs a message at info level

func (*Logger) SetLevel

func (l *Logger) SetLevel(level Level)

SetLevel sets the logging level

func (*Logger) Stop

func (l *Logger) Stop(ctx context.Context) error

Stop gracefully shuts down the logger

func (*Logger) Trace

func (l *Logger) Trace(format string, args ...any)

Trace logs a message at trace level

func (*Logger) Warn

func (l *Logger) Warn(format string, args ...any)

Warn logs a message at warning level

Jump to

Keyboard shortcuts

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