logger

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package logger provides file-based structured logging. Logs are written to <dir>/<name>.log with automatic rotation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

func Error

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

func Get

func Get() *slog.Logger

Get returns the logger instance. Returns a no-op logger if Init hasn't been called.

func Info

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

func Init

func Init(dir, name string) func()

Init initializes the file logger for the app name in dir. Safe to call multiple times; only the first call takes effect. Returns a cleanup function that closes the log file.

func Path

func Path() string

Log path for user reference.

func Session

func Session()

Session logs a separator with session start info.

func Warn

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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