console

package module
v0.0.0-...-d5e3d4b Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 13 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = NewLogger(&defaultLogger, zerolog.DebugLevel)
View Source
var Error = NewLogger(&defaultLogger, zerolog.ErrorLevel)
View Source
var Info = NewLogger(&defaultLogger, zerolog.InfoLevel)
View Source
var Pretty pretty
View Source
var Warn = NewLogger(&defaultLogger, zerolog.WarnLevel)

Functions

func CallerFieldName

func CallerFieldName(name string)

func CallerMarshalFunc

func CallerMarshalFunc(fn func(pc uintptr, file string, line int) string)

func CallerSkipFrameCount

func CallerSkipFrameCount(count int)

func ErrorMarshalFunc

func ErrorMarshalFunc(fn func(err error) interface{})

func Exit

func Exit(v ...any)

func InterfaceMarshalFunc

func InterfaceMarshalFunc(fn func(v interface{}) ([]byte, error))

func LevelDebugValue

func LevelDebugValue(value string)

func LevelErrorValue

func LevelErrorValue(value string)

func LevelFieldMarshalFunc

func LevelFieldMarshalFunc(fn func(l zerolog.Level) string)

func LevelFieldName

func LevelFieldName(name string)

func LevelInfoValue

func LevelInfoValue(value string)

func LevelWarnValue

func LevelWarnValue(value string)

func Log

func Log() zerolog.Logger

func MessageFieldName

func MessageFieldName(name string)

func New

func New(w io.Writer) zerolog.Logger

func NewList

func NewList() *list

func NewTable

func NewTable() *table

func OneLine

func OneLine(format string, v ...any)

func Printf

func Printf(format string, v ...any)

func Println

func Println(v ...any)

func TimeFieldFormat

func TimeFieldFormat(format string)

func TimestampFieldName

func TimestampFieldName(name string)

Types

type Color

type Color int
const (
	Reset Color = iota
	Bold
	Faint
	Italic
	Underline
	BlinkSlow
	BlinkRapid
	ReverseVideo
	Concealed
	CrossedOut
)

Base colors -- attributes in reality

const (
	FgBlack Color = iota + 30
	FgRed
	FgGreen
	FgYellow
	FgBlue
	FgMagenta
	FgCyan
	FgWhite
)

Foreground colors

const (
	FgHiBlack Color = iota + 90
	FgHiRed
	FgHiGreen
	FgHiYellow
	FgHiBlue
	FgHiMagenta
	FgHiCyan
	FgHiWhite
)

Foreground Hi-Intensity colors

const (
	BgBlack Color = iota + 40
	BgRed
	BgGreen
	BgYellow
	BgBlue
	BgMagenta
	BgCyan
	BgWhite
)

Background colors

const (
	BgHiBlack Color = iota + 100
	BgHiRed
	BgHiGreen
	BgHiYellow
	BgHiBlue
	BgHiMagenta
	BgHiCyan
	BgHiWhite
)

Background Hi-Intensity colors

func (Color) Mixed

func (c Color) Mixed(color ...Color) Colors

func (Color) Print

func (c Color) Print(v ...any)

func (Color) Printf

func (c Color) Printf(format string, v ...any)

func (Color) Println

func (c Color) Println(v ...any)

func (Color) Sprint

func (c Color) Sprint(v ...any) string

func (Color) Sprintf

func (c Color) Sprintf(format string, v ...any) string

type Colors

type Colors []Color

func (Colors) Print

func (c Colors) Print(v ...any)

func (Colors) Printf

func (c Colors) Printf(format string, v ...any)

func (Colors) Println

func (c Colors) Println(v ...any)

func (Colors) Sprint

func (c Colors) Sprint(v ...any) string

func (Colors) Sprintf

func (c Colors) Sprintf(format string, v ...any) string

type Logger

type Logger struct {
	Level zerolog.Level
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(logger *zerolog.Logger, level zerolog.Level) *Logger

func (*Logger) Log

func (l *Logger) Log(v any)

func (*Logger) Logf

func (l *Logger) Logf(format string, v ...any)

type SortMode

type SortMode int
const (
	// Asc sorts the column in Ascending order alphabetically.
	Asc SortMode = iota
	// AscNumeric sorts the column in Ascending order numerically.
	AscNumeric
	// Dsc sorts the column in Descending order alphabetically.
	Dsc
	// DscNumeric sorts the column in Descending order numerically.
	DscNumeric
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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