log

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package log provides a simple layer for leveled logging in go.

Index

Constants

This section is empty.

Variables

View Source
var (
	// UseColors can be used to control coloring of the output
	UseColors = true
	// MaxLevel is the maximum level to log at. By default, logging
	// is done at Info level. Using verbose will display all the errors too,
	// Using silent will display only the most relevant information.
	MaxLevel = Info
)

Functions

func Errorf

func Errorf(format string, args ...interface{})

Errorf writes an error message on the screen with the default label

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf exits the program if we encounter a fatal error

func Infof

func Infof(format string, args ...interface{})

Infof writes a info message on the screen with the default label

func Labelf

func Labelf(format string, args ...interface{})

Labelf prints a string on screen with a label interface

func Printf

func Printf(format string, args ...interface{})

Printf prints a string on screen without any extra stuff

func Silentf

func Silentf(format string, args ...interface{})

Silentf writes a message on the stdout with no label

func Verbosef

func Verbosef(format string, label string, args ...interface{})

Verbosef writes a verbose message on the screen with a tabel

func Warningf

func Warningf(format string, args ...interface{})

Warningf writes a warning message on the screen with the default label

Types

type Level

type Level int

Level defines all the available levels we can log at

const (
	Null Level = iota
	Fatal
	Silent
	Label
	Misc
	Error
	Info
	Warning
	Verbose
)

Available logging levels

Jump to

Keyboard shortcuts

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