logs

package
v0.33.12 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

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 Fatal

func Fatal(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 Panic

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

func Print added in v0.33.12

func Print(v ...interface{})

func Printf added in v0.33.12

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

func Println added in v0.33.12

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