logger

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 7 Imported by: 1 module, 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

Overview

Package logger provides the process-wide logging API used by croc.

It preserves croc's established logging API while keeping the configured level in an atomic value, so clients and relay servers may adjust logging without racing concurrent log calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(values ...any)

func Debugf

func Debugf(format string, values ...any)

func Error

func Error(values ...any)

func Errorf

func Errorf(format string, values ...any)

func GetLevel

func GetLevel() string

GetLevel returns the process-wide minimum level.

func Info

func Info(values ...any)

func Infof

func Infof(format string, values ...any)

func SetLevel

func SetLevel(level string)

SetLevel changes the process-wide minimum level. LOGGER takes precedence.

func SetOutput

func SetOutput(w io.Writer)

SetOutput changes the destination for all severity levels.

func Trace

func Trace(values ...any)

func Tracef

func Tracef(format string, values ...any)

func Warn

func Warn(values ...any)

func Warnf

func Warnf(format string, values ...any)

Types

type Logger

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

Logger is a concurrency-safe leveled logger.

func New

func New() *Logger

New returns a logger writing to stdout with trace logging enabled, unless LOGGER selects a different minimum level.

func (*Logger) Debug

func (l *Logger) Debug(values ...any)

func (*Logger) Debugf

func (l *Logger) Debugf(format string, values ...any)

func (*Logger) Error

func (l *Logger) Error(values ...any)

func (*Logger) Errorf

func (l *Logger) Errorf(format string, values ...any)

func (*Logger) GetLevel

func (l *Logger) GetLevel() string

GetLevel returns this logger's minimum level.

func (*Logger) Info

func (l *Logger) Info(values ...any)

func (*Logger) Infof

func (l *Logger) Infof(format string, values ...any)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level string)

SetLevel changes this logger's minimum level.

func (*Logger) SetOutput

func (l *Logger) SetOutput(w io.Writer)

SetOutput changes the destination for all severity levels.

func (*Logger) Trace

func (l *Logger) Trace(values ...any)

func (*Logger) Tracef

func (l *Logger) Tracef(format string, values ...any)

func (*Logger) Warn

func (l *Logger) Warn(values ...any)

func (*Logger) Warnf

func (l *Logger) Warnf(format string, values ...any)

Jump to

Keyboard shortcuts

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