logging

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Log levels
	LevelDebug   = "debug"
	LevelInfo    = "info"
	LevelWarning = "warn"
	LevelError   = "error"
	LevelFatal   = "fatal"
)

Functions

func Debug

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

Debug logs a debug message

func Error

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

Error logs an error message

func Fatal

func Fatal(format string, v ...interface{})

Fatal logs a fatal message and exits

func Info

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

Info logs an info message

func Setup

func Setup(logsDir string, broadcast bool) error

Setup initializes the global logger

func Warn

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

Warn logs a warning message

Types

type Logger

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

Logger is a custom logger that broadcasts to WebSocket and writes to file

func GetLogger

func GetLogger() *Logger

GetLogger returns the global logger instance

func (*Logger) Write

func (l *Logger) Write(p []byte) (n int, err error)

Write implements io.Writer interface for capturing standard log output

Jump to

Keyboard shortcuts

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