uilog

package
v0.27.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VerbositySilent = iota
	VerbosityDefault
	VerbosityVerbose
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*option)

Option configures log output options.

func CustomVerbose

func CustomVerbose(label, color string) Option

CustomVerbose changes the log output to be prefixed with a custom label.

func Silent

func Silent() Option

Silent creates a log output that doesn't print any of the written lines.

func Verbose

func Verbose() Option

Verbose changes the log output to be prefixed with "ignite".

func WithStderr

func WithStderr(r io.WriteCloser) Option

WithStderr sets a custom writer to use instead of the default `os.Stderr`.

func WithStdout

func WithStdout(r io.WriteCloser) Option

WithStdout sets a custom writer to use instead of the default `os.Stdout`.

type Output

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

Output stores writers for standard output and error.

func NewOutput

func NewOutput(options ...Option) (out Output)

NewOutput creates a new log output. By default, the new output uses the default OS stdout and stderr to initialize the outputs with a default verbosity that doesn't change the output.

func (Output) Stderr

func (o Output) Stderr() io.WriteCloser

Stderr returns the standard error writer.

func (Output) Stdout

func (o Output) Stdout() io.WriteCloser

Stdout returns the standard output writer.

func (Output) Verbosity

func (o Output) Verbosity() Verbosity

Verbosity returns the log output verbosity.

type Outputer

type Outputer interface {
	// NewOutput returns a new logging output.
	NewOutput(label, color string) Output

	// Verbosity returns the current verbosity level for the logging output.
	Verbosity() Verbosity
}

Outputer defines an interface for logging output creation.

type Verbosity

type Verbosity uint8

Verbosity enumerates possible verbosity levels for CLI output.

Jump to

Keyboard shortcuts

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