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

logger

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reset  = "\033[0m"
	Red    = "\033[31m"
	Green  = "\033[32m"
	Yellow = "\033[33m"
	Blue   = "\033[34m"
	Cyan   = "\033[36m"
)
View Source
const All = Parser | Renderer | Detail

Variables

This section is empty.

Functions

func Bold

func Bold(text string) string

func BoldUnderline

func BoldUnderline(text string) string

func Colorize

func Colorize(text, color string) string

func Highlight

func Highlight(source []byte, indexes [][2]int, colorFunc func(string) string) string

func Italic

func Italic(text string) string

func Underline

func Underline(text string) string

Types

type LogLevel

type LogLevel uint8
const (
	None   LogLevel = 0
	Parser LogLevel = 1 << iota
	Renderer
	Detail
)

type Logger

type Logger interface {
	SetLogLevel(level LogLevel)
	Log(level LogLevel, msg string, args ...interface{})
	LogMultiline(level LogLevel, msg string, args ...interface{})
	Enter(level LogLevel, msg string, args ...interface{})
	Exit(level LogLevel, msg string, args ...interface{})
}

func NewLogger

func NewLogger() Logger

func Scoped added in v0.7.0

func Scoped(l Logger) Logger

Scoped returns a logger for a single Parse or Render call. A logger created by NewLogger keeps its indentation per call, so concurrent calls do not share it.

Jump to

Keyboard shortcuts

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