format

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: Apache-2.0 Imports: 2 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug = Style{"099", level.Debug, "DEBUG", "✚"}
	Error = Style{"208", level.Error, "ERROR", "✗"}
	Fatal = Style{"160", level.Fatal, "FATAL", "🕱"}
	Good  = Style{"040", level.Good, "GOOD", "🗸"}
	Info  = Style{"045", level.Info, "INFO", "⮞"}
	Panic = Style{"200", level.Panic, "PANIC", "☢"}
	Warn  = Style{"220", level.Warn, "WARNING", "🗲"}
)

Debug style used for prints

Functions

func Full

func Full(s Style, time string, v ...interface{}) string

Full prints a complete log message, with a timestep and label for message type

func Min

func Min(s Style, time string, v ...interface{}) string

Min prints a simplified log message, with only an icon for message type

func Partial added in v1.0.5

func Partial(s Style, time string, v ...interface{}) string

Partial prints a partial log message, with a timestep and icon for message type

func Un

func Un(s Style, time string, v ...interface{}) string

Un prints a Full-style log message, without colors

Types

type Func added in v1.1.0

type Func func(s Style, time string, v ...interface{}) string

Func defines a format function to use for printing

type Style

type Style struct {
	Color  string
	Level  uint8
	Msg    string
	Symbol string
}

Style is a style definition used for prints

Jump to

Keyboard shortcuts

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