logger

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AlwaysLabel displays an airplane on "always" logs.
	AlwaysLabel = "✈"
	// CriticalLabel displays an X on "critical" logs.
	CriticalLabel = "✖"
	// DebugLabel displays a play button on "debug" logs.
	DebugLabel = "▶"
	// InfoLabel displays an i icon on "info" logs.
	InfoLabel = "ℹ"
	// SuccessLabel displays a check mark on "success" logs.
	SuccessLabel = "✔"
	// WarningLabel displays an ! on "warning" logs.
	WarningLabel = "!"
	// AskLabel displays a ? on "ask" logs.
	AskLabel = "?"
)

Variables

View Source
var (
	// Level defines the default log level.
	Level = 3
	// Color toggles output colorization.
	Color = true
	// Timestamps toggles timestamps on output logs.
	Timestamps = false
)

Functions

func Always

func Always(format string, a ...interface{})

Always will "always" print a formatted generic statement to standard output.

func Ask

func Ask(format string, a ...interface{})

Ask will always print a formatted generic statement to standard output formatted to be a question.

func Critical

func Critical(format string, a ...interface{})

Critical will print a formatted generic statement to standard output if the global level is set to 1 or higher. The print statement will have a color of red if color is enabled.

func Debug

func Debug(format string, a ...interface{})

Debug will print a formatted generic statement to standard output if the global level is set to 4 or higher.

func Info

func Info(format string, a ...interface{})

Info will print a formatted generic statement to standard output if the global level is set to 3 or higher. The print statement will have a color of cyan if color is enabled.

func Log

func Log(format string, a ...interface{})

Log will print a formatted generic statement to standard output.

func Success

func Success(format string, a ...interface{})

Success will print a formatted generic statement to standard output if the global level is set to 3 or higher. The print statement will have a color of cyan if color is enabled.

func Table

func Table(headers []string, data [][]string)

Table will print headers and data in a pretty formatted ASCII table.

func Warning

func Warning(format string, a ...interface{})

Warning will print a formatted generic statement to standard output if the global level is set to 2 or higher. The print statement will have a color of yellow if color is enabled.

Types

This section is empty.

Jump to

Keyboard shortcuts

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