Help us shape the future of Go! Take the 2026 Go Developer Survey

logging

package
v0.1.0-rc.10 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package logging configures go-log the same way in every binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecentLogs

func RecentLogs() []string

RecentLogs returns the most recent log lines captured when Options.RingBuffer was enabled in Setup.

func Setup

func Setup(opts Options)

Setup applies opts process-wide.

Types

type Options

type Options struct {
	Level      string // log level: debug, info, warn or error (default: info)
	Format     string // output format: text or json (default: text)
	RingBuffer bool   // also retain the most recent lines in memory (see RecentLogs)
}

Options selects how a binary logs. Zero values keep the defaults: info level, text format and no in-memory ring buffer.

Jump to

Keyboard shortcuts

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