logger

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

logger

standard library log wrapper for non-block logging

installation

go get github.com/gilsuk/logger

Documentation

Index

Constants

View Source
const (
	Debug LogLevel = LogLevel(glg.DEBG)
	Info           = LogLevel(glg.INFO)
	Warn           = LogLevel(glg.WARN)
	Error          = LogLevel(glg.ERR)
	Fatal          = LogLevel(glg.FATAL)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel glg.LEVEL

type Logger

type Logger interface {
	// Close is safe to call multiple times
	Close() error
	Debug(format string, v ...interface{})
	Info(format string, v ...interface{})
	Warn(format string, v ...interface{})
	Error(format string, v ...interface{})
	// Fatal log a message and exit program
	Fatal(format string, v ...interface{})
}

func New

func New(logLevel LogLevel, outputFlags Output, logPath string) (Logger, error)

type Output

type Output int
const (
	StdOut Output = 1 << iota
	FileOut
	Discard
)

Jump to

Keyboard shortcuts

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