log

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 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

Jump to

Keyboard shortcuts

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