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

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