logger

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

phuslulog.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

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

DefaultLogger implements the Logger interface using phuslu/log.

func NewDefaultLogger

func NewDefaultLogger(loggers ...*log.Logger) *DefaultLogger

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(msg string, fields ...Field)

Debug logs a debug-level message.

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(msg string, fields ...Field)

Error logs an error-level message.

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(msg string, fields ...Field)

Info logs an info-level message.

func (*DefaultLogger) Warn

func (l *DefaultLogger) Warn(msg string, fields ...Field)

Warn logs a warn-level message.

type Field

type Field struct {
	Key   string
	Value any
}

Field represents a key-value pair used for structured logging.

type Logger

type Logger interface {
	Debug(msg string, fields ...Field)
	Info(msg string, fields ...Field)
	Warn(msg string, fields ...Field)
	Error(msg string, fields ...Field)
}

Logger is an interface that provides logging at various levels.

Jump to

Keyboard shortcuts

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