Documentation ¶
Index ¶
- Constants
- func CmdLineFlags(flags *flag.FlagSet)
- func Critical(format string, v ...interface{})
- func Debug(selector string, format string, v ...interface{})
- func Err(format string, v ...interface{})
- func Info(format string, v ...interface{})
- func Init(name string, config *Logging) error
- func IsDebug(selector string) bool
- func LogInit(level Priority, prefix string, toSyslog bool, toStderr bool, ...)
- func Recover(msg string)
- func SetStderr()
- func SetToFile(toFile bool, rotator *FileRotator) error
- func SetToStderr(toStderr bool, prefix string)
- func SetToSyslog(toSyslog bool, prefix string)
- func WTF(format string, v ...interface{})
- func Warn(format string, v ...interface{})
- type FileRotator
- func (rotator *FileRotator) CheckIfConfigSane() error
- func (rotator *FileRotator) CreateDirectory() error
- func (rotator *FileRotator) FileExists(file_no int) bool
- func (rotator *FileRotator) FilePath(file_no int) string
- func (rotator *FileRotator) Rotate() error
- func (rotator *FileRotator) WriteLine(line []byte) error
- type Logger
- type Logging
- type Priority
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 CmdLineFlags ¶
Adds logging specific flags to the flag set. The taken flags are -v, -e and -d.
func Init ¶
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 SetToFile ¶
func SetToFile(toFile bool, rotator *FileRotator) error
func SetToStderr ¶
func SetToSyslog ¶
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
Click to show internal directories.
Click to hide internal directories.