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

logging

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogCollector

type LogCollector interface {
	fmt.Stringer
	Logger
}

func NewTestLogger

func NewTestLogger() LogCollector

type LogTree

type LogTree struct {
	// contains filtered or unexported fields
}

func NewLogTree

func NewLogTree(name string) *LogTree

func (*LogTree) Embed

func (c *LogTree) Embed(logs *LogTree)

func (*LogTree) Error

func (c *LogTree) Error(msg ...any)

func (*LogTree) Errorf

func (c *LogTree) Errorf(format string, args ...any)

func (*LogTree) Fork

func (c *LogTree) Fork(message string) *LogTree

func (*LogTree) Info

func (c *LogTree) Info(msg ...any)

func (*LogTree) Infof

func (c *LogTree) Infof(format string, args ...any)

func (*LogTree) IsVerbose

func (c *LogTree) IsVerbose() bool

func (*LogTree) Log

func (c *LogTree) Log(message ...any)

func (*LogTree) Logf

func (c *LogTree) Logf(format string, args ...any)

func (*LogTree) SetVerbose

func (c *LogTree) SetVerbose(verbose bool)

func (*LogTree) String

func (c *LogTree) String() string

func (*LogTree) Verbose

func (c *LogTree) Verbose() Logger

func (*LogTree) Warn

func (c *LogTree) Warn(msg ...any)

func (*LogTree) Warnf

func (c *LogTree) Warnf(format string, args ...any)

type Logger

type Logger interface {
	// Error logs an error message.
	Error(msg ...any)
	// Errorf logs a formatted error message.
	Errorf(format string, args ...any)
	// Warn logs a warning message.
	Warn(msg ...any)
	// Warnf logs a formatted warning message.
	Warnf(format string, args ...any)
	// Info logs an info message.
	Info(msg ...any)
	// Infof logs a formatted info message.
	Infof(format string, args ...any)
	// Log prints a line to the output writer with a header.
	Log(msg ...any)
	// Logf prints a formatted line to the output writer with a header.
	Logf(format string, args ...any)

	// Verbose returns the logger instance if verbose logging is enabled, and otherwise returns nil.
	// A nil logger created with `logging.NewLogger` is safe to call methods on.
	Verbose() Logger
	// IsVerbose returns true if verbose logging is enabled, and false otherwise.
	IsVerbose() bool
	// SetVerbose sets the verbose logging flag.
	SetVerbose(verbose bool)
}

func NewLogger

func NewLogger(output io.Writer) Logger

func NewNopLogger

func NewNopLogger() Logger

NewNopLogger returns a no-op Logger that discards all log messages. It is safe to call any method on the returned Logger.

Jump to

Keyboard shortcuts

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