Documentation ¶
Index ¶
- Variables
- func Close()
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func DialSyslogBackend(network, raddr string, priority syslog.Priority, tag string) (*syslogBackend, error)
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fall()
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Init(config LogConfig) error
- func LogDepth(s Severity, depth int, format string, args ...interface{})
- func LogToStderr()
- func NewMultiBackend(bes ...Backend) (*multiBackend, error)
- func NewSyslogBackend(priorityStr string, tag string) (*syslogBackend, error)
- func Printf(format string, args ...interface{})
- func Rotate(rotateNum1 int, maxSize1 uint64)
- func SetFlushDuration(t time.Duration)
- func SetKeepHours(hours uint)
- func SetLogging(level interface{}, backend Backend)
- func SetRotateByHour(rotateByHour bool)
- func SetSeverity(level interface{})
- func Warning(args ...interface{})
- func Warningf(format string, args ...interface{})
- type Backend
- type FileBackend
- func (self *FileBackend) Fall()
- func (self *FileBackend) Flush()
- func (self *FileBackend) Log(s Severity, msg []byte)
- func (self *FileBackend) Rotate(rotateNum1 int, maxSize1 uint64)
- func (self *FileBackend) SetFlushDuration(t time.Duration)
- func (self *FileBackend) SetKeepHours(hours uint)
- func (self *FileBackend) SetRotateByHour(rotateByHour bool)
- type LogConfig
- type Logger
- func (l *Logger) Close()
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) LogDepth(s Severity, depth int, format string, args ...interface{})
- func (l *Logger) LogToStderr()
- func (l *Logger) PrintfSimple(format string, args ...interface{})
- func (l *Logger) SetLogging(level interface{}, backend Backend)
- func (l *Logger) SetSeverity(level interface{})
- func (l *Logger) Warning(args ...interface{})
- func (l *Logger) Warningf(format string, args ...interface{})
- type Severity
Constants ¶
This section is empty.
Variables ¶
View Source
var SyslogPriorityMap = map[string]syslog.Priority{ "local0": syslog.LOG_LOCAL0, "local1": syslog.LOG_LOCAL1, "local2": syslog.LOG_LOCAL2, "local3": syslog.LOG_LOCAL3, "local4": syslog.LOG_LOCAL4, "local5": syslog.LOG_LOCAL5, "local6": syslog.LOG_LOCAL6, "local7": syslog.LOG_LOCAL7, }
Functions ¶
func DialSyslogBackend ¶
func LogToStderr ¶
func LogToStderr()
func NewMultiBackend ¶
func NewSyslogBackend ¶
func SetFlushDuration ¶
func SetKeepHours ¶
func SetKeepHours(hours uint)
func SetLogging ¶
func SetLogging(level interface{}, backend Backend)
func SetRotateByHour ¶
func SetRotateByHour(rotateByHour bool)
func SetSeverity ¶
func SetSeverity(level interface{})
Types ¶
type FileBackend ¶
type FileBackend struct {
// contains filtered or unexported fields
}
func NewFileBackend ¶
func NewFileBackend(dir string) (*FileBackend, error)
func (*FileBackend) Fall ¶
func (self *FileBackend) Fall()
func (*FileBackend) Flush ¶
func (self *FileBackend) Flush()
func (*FileBackend) Log ¶
func (self *FileBackend) Log(s Severity, msg []byte)
func (*FileBackend) Rotate ¶
func (self *FileBackend) Rotate(rotateNum1 int, maxSize1 uint64)
func (*FileBackend) SetFlushDuration ¶
func (self *FileBackend) SetFlushDuration(t time.Duration)
func (*FileBackend) SetKeepHours ¶
func (self *FileBackend) SetKeepHours(hours uint)
func (*FileBackend) SetRotateByHour ¶
func (self *FileBackend) SetRotateByHour(rotateByHour bool)
type LogConfig ¶
type LogConfig struct { Type string // syslog/stderr/std/file Level string // DEBUG/INFO/WARNING/ERROR/FATAL SyslogPriority string // local0-7 SyslogSeverity string FileName string FileRotateCount int FileRotateSize uint64 FileFlushDuration time.Duration RotateByHour bool KeepHours uint // make sense when RotateByHour is T }
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLoggerFromConfig ¶
func (*Logger) LogDepth ¶
/////////////////////////////////////////////////////////////// depth version, only a low level api
func (*Logger) LogToStderr ¶
func (l *Logger) LogToStderr()
func (*Logger) PrintfSimple ¶
func (*Logger) SetLogging ¶
func (*Logger) SetSeverity ¶
func (l *Logger) SetSeverity(level interface{})
Click to show internal directories.
Click to hide internal directories.