logext

package
v2.12.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package logext contains log extensions.

Index

Constants

This section is empty.

Variables

View Source
var (
	// URL is used to style URLs.
	URL = lipgloss.NewStyle().
		Foreground(lipgloss.Color("3")).
		Render

	// Warning is used to style warnings for the user.
	Warning = lipgloss.NewStyle().
			Foreground(lipgloss.Color("11")).
			Bold(true).
			Render

	// Keyword should be used to highlight code.
	Keyword = lipgloss.NewStyle().
			Foreground(lipgloss.Color("#ED567A")).
			Background(lipgloss.Color("#242424")).
			Render

	// Faint is fainted, italic, text.
	Faint = lipgloss.NewStyle().
			Italic(true).
			Faint(true).
			Render
)

Functions

func Duration

func Duration(start time.Time, threshold time.Duration)

Duration logs the given duration if it exceeds the given threshold.

func NewConditionalWriter

func NewConditionalWriter(condition bool) io.Writer

NewConditionalWriter creates a new log writer that only writes when the given condition is met or debug is enabled.

func NewWriter

func NewWriter() io.Writer

NewWriter creates a new log writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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