log

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package log is a thin slog-backed wrapper that preserves the outbrain/golib/log call surface (Debug/Info/Warning/Fatal etc.) while removing the external dependency. Output format: "YYYY-MM-DD HH:MM:SS LEVEL message".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Critical

func Critical(args ...any)

func Criticalf

func Criticalf(format string, args ...any)

func Debug

func Debug(args ...any)

func Debugf

func Debugf(format string, args ...any)

func Error

func Error(args ...any)

func Errorf

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

func Fatal

func Fatal(args ...any)

func Fatalf

func Fatalf(format string, args ...any)

func Info

func Info(args ...any)

func Infof

func Infof(format string, args ...any)

func RegisterExitHook

func RegisterExitHook(fn func())

RegisterExitHook registers fn to be called before os.Exit in Fatal/Fatalf. Hooks run in registration order. Safe to call concurrently.

func SetLevel

func SetLevel(l Level)

SetLevel sets the minimum log level.

func Warning

func Warning(args ...any)

func Warningf

func Warningf(format string, args ...any)

Types

type Level

type Level = slog.Level

Level aliases slog.Level so existing log.DEBUG / log.INFO / log.WARNING constants compile without changes at call sites.

const (
	DEBUG   Level = slog.LevelDebug
	INFO    Level = slog.LevelInfo
	WARNING Level = slog.LevelWarn
)

Jump to

Keyboard shortcuts

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