logger

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package logger is an adaptation wrapper that simplifies logging in the main code whilst also allowing a pluggable test logger.

Index

Constants

This section is empty.

Variables

View Source
var Exit = func(code int) {
	os.Exit(code + int(errorCount.Load()))
}
View Source
var Logger = slog.Default()

Logger is a global logger that is able to handle concurrent logging safely.

Functions

func Create

func Create(logFile string, opts *slog.HandlerOptions)

Create updates Logger to use a specific log file (or stdout), based on a specified log file name.

func Debug

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

func Error

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

func Errorf

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

func HttpLogConfig

func HttpLogConfig() sloghttp.Config

HttpLogConfig provides configuration options for the HTTP logger, if used.

func Info

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

func Log

func Log(level slog.Level, msg string, args ...any)

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