logger

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package logger provides a logging utility for Gophercast.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Level      LogLevel
	Output     string
	TimeFormat string
}

type LogLevel

type LogLevel string
const (
	LevelDebug LogLevel = "debug"
	LevelInfo  LogLevel = "info"
	LevelWarn  LogLevel = "warn"
	LevelError LogLevel = "error"
)

type Logger

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

Logger wraps slog.Logger with some extra helpers and structured fields.

func New

func New(config Config) (*Logger, error)

func (*Logger) ClientConnected

func (l *Logger) ClientConnected(clientID string, clientIP string)

func (*Logger) ClientDisconnected

func (l *Logger) ClientDisconnected(clientID string, reason string)

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) ErrorOccurred

func (l *Logger) ErrorOccurred(err error, context string)

func (*Logger) PlaylistCreated

func (l *Logger) PlaylistCreated(playlistID string, trackCount int)

func (*Logger) ServerStarted

func (l *Logger) ServerStarted(port int)

func (*Logger) ServerStopped

func (l *Logger) ServerStopped(reason string)

func (*Logger) TrackPlayed

func (l *Logger) TrackPlayed(trackID string, clientID string, duration time.Duration)

Jump to

Keyboard shortcuts

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