log

package
v0.0.0-...-6bc8604 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: GPL-3.0 Imports: 12 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLogFormatInvalid = errors.New("invalid log format name")
)
View Source
var (
	ErrLogLevelInvalid = errors.New("invalid log level name")
)

Functions

func BgBlack

func BgBlack(arg interface{}) aurora.Value

Background colors

BgBlack background color (40)

func BgBlue

func BgBlue(arg interface{}) aurora.Value

BgBlue background color (44)

func BgBrightBlack

func BgBrightBlack(arg interface{}) aurora.Value

Bright background colors

BgBrightBlack background color (100)

func BgBrightBlue

func BgBrightBlue(arg interface{}) aurora.Value

BgBrightBlue background color (104)

func BgBrightCyan

func BgBrightCyan(arg interface{}) aurora.Value

BgBrightCyan background color (106)

func BgBrightGreen

func BgBrightGreen(arg interface{}) aurora.Value

BgBrightGreen background color (102)

func BgBrightMagenta

func BgBrightMagenta(arg interface{}) aurora.Value

BgBrightMagenta background color (105)

func BgBrightRed

func BgBrightRed(arg interface{}) aurora.Value

BgBrightRed background color (101)

func BgBrightWhite

func BgBrightWhite(arg interface{}) aurora.Value

BgBrightWhite background color (107)

func BgBrightYellow

func BgBrightYellow(arg interface{}) aurora.Value

BgBrightYellow background color (103)

func BgBrown deprecated

func BgBrown(arg interface{}) aurora.Value

BgBrown background color (43)

Deprecated: use BgYellow instead, following specification

func BgCyan

func BgCyan(arg interface{}) aurora.Value

BgCyan background color (46)

func BgGray

func BgGray(n uint8, arg interface{}) aurora.Value

BgGray from 0 to 23.

func BgGreen

func BgGreen(arg interface{}) aurora.Value

BgGreen background color (42)

func BgIndex

func BgIndex(n uint8, arg interface{}) aurora.Value

Other

BgIndex of 8-bit pre-defined background color from 0 to 255 (48;5;n).

  0-  7:  standard colors (as in ESC [ 40–47 m)
  8- 15:  high intensity colors (as in ESC [100–107 m)
 16-231:  6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5)
232-255:  grayscale from black to white in 24 steps

func BgMagenta

func BgMagenta(arg interface{}) aurora.Value

BgMagenta background color (45)

func BgRed

func BgRed(arg interface{}) aurora.Value

BgRed background color (41)

func BgWhite

func BgWhite(arg interface{}) aurora.Value

BgWhite background color (47)

func BgYellow

func BgYellow(arg interface{}) aurora.Value

BgYellow background color (43)

func Black

func Black(arg interface{}) aurora.Value

Foreground colors

Black foreground color (30)

func Blink(arg interface{}) aurora.Value

Blink is alias for the SlowBlink.

func Blue

func Blue(arg interface{}) aurora.Value

Blue foreground color (34)

func Bold

func Bold(arg interface{}) aurora.Value

Formats

Bold or increased intensity (1).

func BrightBlack

func BrightBlack(arg interface{}) aurora.Value

Bright foreground colors

BrightBlack foreground color (90)

func BrightBlue

func BrightBlue(arg interface{}) aurora.Value

BrightBlue foreground color (94)

func BrightCyan

func BrightCyan(arg interface{}) aurora.Value

BrightCyan foreground color (96)

func BrightGreen

func BrightGreen(arg interface{}) aurora.Value

BrightGreen foreground color (92)

func BrightMagenta

func BrightMagenta(arg interface{}) aurora.Value

BrightMagenta foreground color (95)

func BrightRed

func BrightRed(arg interface{}) aurora.Value

BrightRed foreground color (91)

func BrightWhite

func BrightWhite(arg interface{}) aurora.Value

BrightWhite foreground color (97)

func BrightYellow

func BrightYellow(arg interface{}) aurora.Value

BrightYellow foreground color (93)

func Brown deprecated

func Brown(arg interface{}) aurora.Value

Brown foreground color (33)

Deprecated: use Yellow instead, following specification

func Conceal

func Conceal(arg interface{}) aurora.Value

Conceal, hidden, not widely supported (8).

func ConfigurePersistentLogging

func ConfigurePersistentLogging(fn string, isMux bool) error

ConfigurePersistentLogging adds a log-to-file writer. File content is identical to stdout.

func CrossedOut

func CrossedOut(arg interface{}) aurora.Value

CrossedOut, characters legible, but marked for deletion (9).

func Cyan

func Cyan(arg interface{}) aurora.Value

Cyan foreground color (36)

func Debug

func Debug(v string, params ...interface{})

func DisableColor

func DisableColor()

func DoublyUnderline

func DoublyUnderline(arg interface{}) aurora.Value

DoublyUnderline or Bold off, double-underline per ECMA-48 (21).

func Encircled

func Encircled(arg interface{}) aurora.Value

Encircled (52).

func Error

func Error(v string, params ...interface{})

func Faint

func Faint(arg interface{}) aurora.Value

Faint, decreased intensity (2).

func Fatal

func Fatal(v string, params ...interface{})

func ForceColor

func ForceColor()

func Fraktur

func Fraktur(arg interface{}) aurora.Value

Fraktur, rarely supported (20).

func Framed

func Framed(arg interface{}) aurora.Value

Framed (51).

func Gray

func Gray(n uint8, arg interface{}) aurora.Value

Gray from 0 to 23.

func Green

func Green(arg interface{}) aurora.Value

Green foreground color (32)

func Hidden

func Hidden(arg interface{}) aurora.Value

Hidden is alias for the Conceal

func Index

func Index(n uint8, arg interface{}) aurora.Value

Other

Index of pre-defined 8-bit foreground color from 0 to 255 (38;5;n).

  0-  7:  standard colors (as in ESC [ 30–37 m)
  8- 15:  high intensity colors (as in ESC [ 90–97 m)
 16-231:  6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5)
232-255:  grayscale from black to white in 24 steps

func Info

func Info(v string, params ...interface{})

func Init

func Init(logLevel Level, format Format, sync bool) error

Initialize the Logger

func Inverse

func Inverse(arg interface{}) aurora.Value

Inverse is alias for the Reverse

func IsDebug

func IsDebug() bool

func Italic

func Italic(arg interface{}) aurora.Value

Italic, not widely supported, sometimes treated as inverse (3).

func Magenta

func Magenta(arg interface{}) aurora.Value

Magenta foreground color (35)

func Overlined

func Overlined(arg interface{}) aurora.Value

Overlined (53).

func RapidBlink(arg interface{}) aurora.Value

RapidBlink, blinking 150+ per minute, not widely supported (6).

func Red

func Red(arg interface{}) aurora.Value

Red foreground color (31)

func Reverse

func Reverse(arg interface{}) aurora.Value

Reverse video, swap foreground and background colors (7).

func SetLevel

func SetLevel(logLevel Level)

func ShortHex

func ShortHex(bytes []byte) string
func SlowBlink(arg interface{}) aurora.Value

SlowBlink, blinking less than 150 per minute (5).

func StrikeThrough

func StrikeThrough(arg interface{}) aurora.Value

StrikeThrough is alias for the CrossedOut.

func TestingHook

func TestingHook(t *testing.T) *test.Hook

func Trace

func Trace(v string, params ...interface{})

func Underline

func Underline(arg interface{}) aurora.Value

Underline (4).

func Warn

func Warn(v string, params ...interface{})

func White

func White(arg interface{}) aurora.Value

White foreground color (37)

func Yellow

func Yellow(arg interface{}) aurora.Value

Yellow foreground color (33)

Types

type Format

type Format uint32
const (
	TextFormat Format = iota
	JsonFormat
	FluentdFormat
	JournaldFormat
)

func ParseFormat

func ParseFormat(format string) (Format, error)

type Level

type Level uint32
const (
	// PanicLevel level, highest level of severity. Logs and then calls panic with the
	// message passed to Debug, Info, ...
	PanicLevel Level = iota
	// FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the
	// logging level is set to Panic.
	FatalLevel
	// ErrorLevel level. Logs. Used for errors that should definitely be noted.
	// Commonly used for hooks to send errors to an error tracking service.
	ErrorLevel
	// WarnLevel level. Non-critical entries that deserve eyes.
	WarnLevel
	// InfoLevel level. General operational entries about what's going on inside the
	// application.
	InfoLevel
	// DebugLevel level. Usually only enabled when debugging. Very verbose logging.
	DebugLevel
	// TraceLevel level. Designates finer-grained informational events than the Debug.
	TraceLevel
)

func GetLevel

func GetLevel() Level

func ParseLevel

func ParseLevel(lvl string) (Level, error)

ParseLevel takes a string level and returns the Logrus log level constant.

Jump to

Keyboard shortcuts

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