Documentation ¶
Index ¶
- Constants
- func Critical(format string, v ...interface{})
- func Debug(selector string, format string, v ...interface{})
- func Err(format string, v ...interface{})
- func HandleFlags(name string) error
- func HasSelector(selector string) bool
- 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 LogTotalExpvars(cfg *Logging)
- func MakeDebug(selector string) func(string, ...interface{})
- 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(fileNo int) bool
- func (rotator *FileRotator) FilePath(fileNo int) string
- func (rotator *FileRotator) Rotate() error
- func (rotator *FileRotator) WriteLine(line []byte) error
- type Logger
- type Logging
- type LoggingMetricsConfig
- 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 HandleFlags ¶ added in v5.3.0
func HasSelector ¶ added in v5.3.0
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 LogTotalExpvars ¶
func LogTotalExpvars(cfg *Logging)
LogTotalExpvars logs all registered expvar metrics.
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 Permissions *uint32 // 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(fileNo int) bool
func (*FileRotator) FilePath ¶
func (rotator *FileRotator) FilePath(fileNo int) string
func (*FileRotator) Rotate ¶
func (rotator *FileRotator) Rotate() error
func (*FileRotator) WriteLine ¶
func (rotator *FileRotator) WriteLine(line []byte) error
type Logging ¶
type Logging struct { Selectors []string Files *FileRotator ToSyslog *bool `config:"to_syslog"` ToFiles *bool `config:"to_files"` Level string Metrics LoggingMetricsConfig `config:"metrics"` }
type LoggingMetricsConfig ¶
Click to show internal directories.
Click to hide internal directories.