log

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package log provides structured file-based logging with rotation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithRequestID

func ContextWithRequestID(ctx context.Context, requestID string) context.Context

func Debug

func Debug(msg string, args ...any)

Global convenience functions

func Error

func Error(msg string, args ...any)

func Fatal

func Fatal(msg string, args ...any)

func Info

func Info(msg string, args ...any)

func Initialize

func Initialize(config Config)

func RequestIDFromContext

func RequestIDFromContext(ctx context.Context) string

func Warn

func Warn(msg string, args ...any)

Types

type Config

type Config struct {
	Level       slog.Level
	LogFilePath string
}

type Logger

type Logger struct {
	*slog.Logger
	// contains filtered or unexported fields
}

func Global

func Global() *Logger

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) WithRequestID

func (l *Logger) WithRequestID(requestID string) *slog.Logger

Jump to

Keyboard shortcuts

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