logs

package
v0.34.10 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: GPL-3.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger    zerolog.Logger
	ZapLogger *zap.Logger
)

Functions

func Debug

func Debug(msg string, v ...interface{})

func EnableInMemoryBuffer

func EnableInMemoryBuffer(capacity int)

EnableInMemoryBuffer activates an in-memory circular buffer of given capacity

func Error

func Error(msg string, v ...interface{})

func GetBufferedLogs

func GetBufferedLogs() string

GetBufferedLogs returns and clears the in-memory buffer

func Info

func Info(msg string, v ...interface{})

func Init

func Init(
	logType, logLevel, logPath string,
	maxSize, maxBackups, maxAge int,
	compress bool,
	color bool,
)

Init initializes the global logger. logType: "stdout"|"file"|"both"|"off" logLevel: "trace"|"debug"|"info"|"warn"|"error"|"fatal"|"panic"|"off" logPath: file path (required for file/both) maxSize: max size per file in MB maxBackups: max number of backups maxAge: max age in days compress: whether to compress old logs color: whether to enable ANSI color codes in console output

func Printf added in v0.29.26

func Printf(msg string, v ...interface{})

func Println added in v0.29.26

func Println(v ...interface{})

func SetLevel

func SetLevel(levelStr string)

SetLevel updates the global minimum level

func Trace

func Trace(msg string, v ...interface{})

func Warn

func Warn(msg string, v ...interface{})

Types

type BufferWriter

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

func NewBufferWriter

func NewBufferWriter(capacity int) *BufferWriter

func (*BufferWriter) GetAndClear

func (w *BufferWriter) GetAndClear() string

func (*BufferWriter) Write

func (w *BufferWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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