log

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int

Level type encode the log level.

const (
	DebugLevel Level = iota
	InfoLevel
	ErrorLevel
	Quiet
)

The following constants represent all possible values for the log level.

type Logger

type Logger interface {
	Error(msg string, a ...interface{})
	Info(msg string, a ...interface{})
	Debug(msg string, a ...interface{})
}

Logger is a very basic log interface.

func New

func New(options ...Option) Logger

New creates a new Logger with Options.

type Option

type Option func(*log)

Option is a log configuration function.

func WithColor

func WithColor() Option

WithColor indicates to use colors when logging.

func WithLevel

func WithLevel(lev Level) Option

WithLevel set the log level.

func WithWriter

func WithWriter(w io.Writer) Option

WithWriter set the log io.Writer.

func WithoutColor

func WithoutColor() Option

WithColor indicates to not use colors when logging.

Jump to

Keyboard shortcuts

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