avyos.dev/pkg/logger
package logger
Package Overview
No package-level documentation is provided.
| Export Group | Count |
|---|---|
| Constants | 0 |
| Variables | 1 |
| Functions | 5 |
| Types | 2 |
Variables
var Default = New("")Default is the default logger instance
Functions
func Debug(format string, args ...interface{})Debug logs a debug message using the default logger
func Error(format string, args ...interface{})Error logs an error message using the default logger
func Info(format string, args ...interface{})Info logs an info message using the default logger
func SetupSystemLog() errorSetupSystemLog 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(format string, args ...interface{})Warn logs a warning message using the default logger
Types
Level
type Level intLevel represents the log severity level
Constants
const (
DEBUG Level = iota
INFO
WARN
ERROR
)Methods
func (l Level) String() stringString returns the string representation of the log level
Logger
type Logger struct {
// contains filtered or unexported fields
}Logger provides structured logging with levels and components
Functions
func New(component string) *LoggerNew creates a new logger for the given component
Methods
func (l *Logger) Debug(format string, args ...interface{})Debug logs a debug message
func (l *Logger) Error(format string, args ...interface{})Error logs an error message
func (l *Logger) Info(format string, args ...interface{})Info logs an info message
func (l *Logger) SetLevel(level Level)SetLevel sets the minimum log level
func (l *Logger) Warn(format string, args ...interface{})Warn logs a warning message
func (l *Logger) With(key string, value interface{}) *LoggerWith returns a new logger with the given field attached