Documentation
¶
Overview ¶
Package log provides a compatibility layer for go-ethereum style logging that redirects to luxfi/log
Index ¶
- Constants
- Variables
- func Crit(msg string, ctx ...interface{})
- func Debug(msg string, ctx ...interface{})
- func DiscardHandler() slog.Handler
- func Enabled(ctx context.Context, level slog.Level) bool
- func Error(msg string, ctx ...interface{})
- func FileHandler(path string, fmtr Formatter) (slog.Handler, error)
- func FromLegacyLevel(lvl int) slog.Level
- func Info(msg string, ctx ...interface{})
- func LevelAlignedString(l slog.Level) string
- func LevelString(l slog.Level) string
- func LvlFilterHandler(maxLevel slog.Level, h slog.Handler) slog.Handler
- func LvlFromString(lvlString string) (slog.Level, error)
- func NewTerminalHandler(w io.Writer, useColor bool) slog.Handler
- func SetDefault(l Logger)
- func StreamHandler(w io.Writer, fmtr Formatter) slog.Handler
- func Trace(msg string, ctx ...interface{})
- func Warn(msg string, ctx ...interface{})
- type Formatter
- type GlogHandler
- type Logger
Constants ¶
const ( // Level constants - use slog.Level values directly to avoid conflicts LevelTrace slog.Level = -8 LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError LevelCrit slog.Level = 12 // Backward compatibility LvlTrace = LevelTrace LvlInfo = LevelInfo LvlDebug = LevelDebug )
Variables ¶
var ( New = luxlog.New Root = luxlog.Root )
Re-export functions from luxfi/log
Functions ¶
func DiscardHandler ¶
DiscardHandler returns a handler that discards all log records
func FileHandler ¶
FileHandler returns a handler that writes to a file
func FromLegacyLevel ¶
FromLegacyLevel converts from old Geth verbosity level constants
func LevelAlignedString ¶
LevelAlignedString returns a 5-character string containing the name of a level
func LevelString ¶
LevelString returns a string containing the name of a level
func LvlFilterHandler ¶
LvlFilterHandler returns a handler that filters by level
func LvlFromString ¶
LvlFromString returns the appropriate level from a string name
func NewTerminalHandler ¶
NewTerminalHandler creates a handler that writes to terminal
func StreamHandler ¶
StreamHandler returns a handler that writes to an io.Writer
Types ¶
type Formatter ¶
type Formatter interface{}
Formatter interface for compatibility
func TerminalFormat ¶
TerminalFormat returns a terminal formatter
type GlogHandler ¶
type GlogHandler struct {
// contains filtered or unexported fields
}
Handler types for compatibility
func NewGlogHandler ¶
func NewGlogHandler(handler slog.Handler) *GlogHandler
NewGlogHandler creates a new glog handler
func (*GlogHandler) SetHandler ¶
func (h *GlogHandler) SetHandler(handler slog.Handler)
SetHandler sets the handler (no-op for compatibility)
func (*GlogHandler) Verbosity ¶
func (h *GlogHandler) Verbosity(level slog.Level)
Verbosity sets the verbosity level (no-op for compatibility)