log

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package log implements a simple logging package with severity level.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(v ...interface{})

Debug logs a debug information Arguments are handled in the manner of fmt.Print

func Debugf

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

Debugf logs a debug information Arguments are handled in the manner of fmt.Printf

func Fatal

func Fatal(v ...interface{})

Fatal logs a fatal event and exit Arguments are handled in the manner of fmt.Print followed by a call to os.Exit(1)

func Fatalf

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

Fatalf logs a fatal event and exit Arguments are handled in the manner of fmt.Printf followed by a call to os.Exit(1)

func Info

func Info(v ...interface{})

Info logs an information Arguments are handled in the manner of fmt.Print

func Infof

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

Infof logs an information Arguments are handled in the manner of fmt.Printf

func PrintTemplate

func PrintTemplate(w io.Writer, textTemplate string, data interface{})

PrintTemplate prints the parsed text template to the specified data object, and writes the output to w.

func SetLevel

func SetLevel(level Level)

SetLevel sets the logger level

Types

type Level

type Level int

Level defines the log verbosity

const (
	// LevelSilent is the silent level. Use to silent log events.
	LevelSilent Level = iota
	// LevelInfo is the info level. Use to log interesting events.
	LevelInfo
	// LevelDebug is the debug level. Use to log detailed debug information.
	LevelDebug
)

Jump to

Keyboard shortcuts

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