logger

package
v0.0.0-...-143e6d5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = New("")

Default is the default logger instance

Functions

func Debug

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

Debug logs a debug message using the default logger

func Error

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

Error logs an error message using the default logger

func Info

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

Info logs an info message using the default logger

func SetupSystemLog

func SetupSystemLog() error

SetupSystemLog configures process logging to append to a per-process log file while preserving stdout/stderr output.

Root/system process path:

fs.Resolve("cache:log/services/<name>.log")

User process path:

$HOME/.cache/log/services/<name>.log

func Warn

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

Warn logs a warning message using the default logger

Types

type Level

type Level int

Level represents the log severity level

const (
	DEBUG Level = iota
	INFO
	WARN
	ERROR
)

func (Level) String

func (l Level) String() string

String returns the string representation of the log level

type Logger

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

Logger provides structured logging with levels and components

func New

func New(component string) *Logger

New creates a new logger for the given component

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

Debug logs a debug message

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

Error logs an error message

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

Info logs an info message

func (*Logger) SetLevel

func (l *Logger) SetLevel(level Level)

SetLevel sets the minimum log level

func (*Logger) Warn

func (l *Logger) Warn(format string, args ...interface{})

Warn logs a warning message

func (*Logger) With

func (l *Logger) With(key string, value interface{}) *Logger

With returns a new logger with the given field attached

Jump to

Keyboard shortcuts

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