logp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultKeepFiles = 7
View Source
const DefaultRotateEveryBytes = 10 * 1024 * 1024
View Source
const RotatorMaxFiles = 1024

Variables

This section is empty.

Functions

func Critical

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

func Debug

func Debug(selector string, format string, v ...interface{})

func Err

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

func Info

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

func Init

func Init(name string, config *Logging) error

Init combines the configuration from config with the command line flags to initialize the Logging systems. After calling this function, standard output is always enabled. You can make it respect the command line flag with a later SetStderr call.

func IsDebug

func IsDebug(selector string) bool

func LogInit

func LogInit(level Priority, prefix string, toSyslog bool, toStderr bool, debugSelectors []string)

TODO: remove toSyslog and toStderr from the init function

func MakeDebug

func MakeDebug(selector string) func(string, ...interface{})

func Recover

func Recover(msg string)

func SetStderr

func SetStderr()

func SetToFile

func SetToFile(toFile bool, rotator *FileRotator) error

func SetToStderr

func SetToStderr(toStderr bool, prefix string)

func SetToSyslog

func SetToSyslog(toSyslog bool, prefix string)

func WTF

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

WTF prints the message at CRIT level and panics immediately with the same message

func Warn

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

Types

type FileRotator

type FileRotator struct {
	Path             string
	Name             string
	RotateEveryBytes *uint64
	KeepFiles        *int
	// contains filtered or unexported fields
}

func (*FileRotator) CheckIfConfigSane

func (rotator *FileRotator) CheckIfConfigSane() error

func (*FileRotator) CreateDirectory

func (rotator *FileRotator) CreateDirectory() error

func (*FileRotator) FileExists

func (rotator *FileRotator) FileExists(file_no int) bool

func (*FileRotator) FilePath

func (rotator *FileRotator) FilePath(file_no int) string

func (*FileRotator) Rotate

func (rotator *FileRotator) Rotate() error

func (*FileRotator) WriteLine

func (rotator *FileRotator) WriteLine(line []byte) error

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

type Logging

type Logging struct {
	Selectors []string
	Files     *FileRotator
	To_syslog *bool
	To_files  *bool
	Level     string
}

type Priority

type Priority int
const (
	// From /usr/include/sys/syslog.h.
	// These are the same on Linux, BSD, and OS X.
	LOG_EMERG Priority = iota
	LOG_ALERT
	LOG_CRIT
	LOG_ERR
	LOG_WARNING
	LOG_NOTICE
	LOG_INFO
	LOG_DEBUG
)

Jump to

Keyboard shortcuts

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