log

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LvlCrit  = Lvl(log15.LvlCrit)
	LvlError = Lvl(log15.LvlError)
	LvlWarn  = Lvl(log15.LvlWarn)
	LvlInfo  = Lvl(log15.LvlInfo)
	LvlDebug = Lvl(log15.LvlDebug)
)

Variables

This section is empty.

Functions

func AddLogConsFlags

func AddLogConsFlags()

func AddLogFileFlags

func AddLogFileFlags()

func Crit

func Crit(msg string, ctx ...interface{})

func Debug

func Debug(msg string, ctx ...interface{})

func Error

func Error(msg string, ctx ...interface{})

func Flush

func Flush()

func Info

func Info(msg string, ctx ...interface{})

func Log added in v0.1.1

func Log(lvl Lvl, msg string, ctx ...interface{})

func LogPanicAndExit

func LogPanicAndExit()

func RandId

func RandId(idlen int) string

func SetupFromFlags

func SetupFromFlags(name string) error

func SetupLogConsole

func SetupLogConsole(logConsole string) error

func SetupLogFile

func SetupLogFile(name string, logDir string, logLevel string, logSize int, logAge int,
	logFlush int) error

SetupLogFile initializes a file for logging. The path is logDir/name.log if name doesn't already contain the .log extension, or logDir/name otherwise. logLevel can be one of debug, info, warn, error, and crit and states the minimum level of logging events that get written to the file. logSize is the maximum size, in MiB, until the log rotates. logAge is the maximum number of days to retain old log files. If logFlush > 0, logging output is buffered, and flushed every logFlush seconds. If logFlush < 0: logging output is buffered, but must be manually flushed by calling Flush(). If logFlush = 0 logging output is unbuffered and Flush() is a no-op.

func Warn

func Warn(msg string, ctx ...interface{})

Types

type Handler

type Handler log15.Handler

func DiscardHandler

func DiscardHandler() Handler

type Logger

type Logger log15.Logger

func New

func New(ctx ...interface{}) Logger

func Root

func Root() Logger

type Lvl added in v0.1.1

type Lvl log15.Lvl

func LvlFromString added in v0.1.1

func LvlFromString(lvl string) (Lvl, error)

func (Lvl) String added in v0.1.1

func (l Lvl) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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