Help us shape the future of Go! Take the 2026 Go Developer Survey

gologger

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 5 Imported by: 2,616

README

gologger

gologger is a very simple logger for fast logging in simple command line tools.

Documentation

Overview

Package gologger 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 Debugf

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

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

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
	Debug
	Verbose
)

Available logging levels

Jump to

Keyboard shortcuts

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