Documentation ¶
Index ¶
- type BackendSysLogWriter
- type ChanLogger
- func (that *ChanLogger) ClearAllLogFile() error
- func (that *ChanLogger) ClearCurLogFile() error
- func (that *ChanLogger) Close() error
- func (that *ChanLogger) ReadLog(_ int64, _ int64) (string, error)
- func (that *ChanLogger) ReadTailLog(_ int64, _ int64) (string, int64, bool, error)
- func (that *ChanLogger) SetPid(_ int)
- func (that *ChanLogger) Write(p []byte) (int, error)
- type FileLogger
- func (that *FileLogger) ClearAllLogFile() error
- func (that *FileLogger) ClearCurLogFile() error
- func (that *FileLogger) Close() error
- func (that *FileLogger) ReadLog(offset int64, length int64) (string, error)
- func (that *FileLogger) ReadTailLog(offset int64, length int64) (string, int64, bool, error)
- func (that *FileLogger) SetPid(pid int)
- func (that *FileLogger) Write(p []byte) (int, error)
- type Logger
- type MultiLogger
- func (that *MultiLogger) AddLogger(logger Logger)
- func (that *MultiLogger) ClearAllLogFile() error
- func (that *MultiLogger) ClearCurLogFile() error
- func (that *MultiLogger) Close() (err error)
- func (that *MultiLogger) ReadLog(offset int64, length int64) (string, error)
- func (that *MultiLogger) ReadTailLog(offset int64, length int64) (string, int64, bool, error)
- func (that *MultiLogger) RemoveLogger(logger Logger)
- func (that *MultiLogger) SetPid(pid int)
- func (that *MultiLogger) Write(p []byte) (n int, err error)
- type NullLocker
- type NullLogger
- func (that *NullLogger) ClearAllLogFile() error
- func (that *NullLogger) ClearCurLogFile() error
- func (that *NullLogger) Close() error
- func (that *NullLogger) ReadLog(offset int64, length int64) (string, error)
- func (that *NullLogger) ReadTailLog(offset int64, length int64) (string, int64, bool, error)
- func (that *NullLogger) SetPid(pid int)
- func (that *NullLogger) Write(p []byte) (int, error)
- type StdLogger
- type SysLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendSysLogWriter ¶
type BackendSysLogWriter struct {
// contains filtered or unexported fields
}
func NewBackendSysLogWriter ¶
func NewBackendSysLogWriter(network, raddr string, priority syslog.Priority, tag string) *BackendSysLogWriter
NewBackendSysLogWriter creates background syslog writer
func (*BackendSysLogWriter) Close ¶
func (bs *BackendSysLogWriter) Close() error
Close background write channel
type ChanLogger ¶
type ChanLogger struct {
// contains filtered or unexported fields
}
func NewChanLogger ¶
func NewChanLogger(channel chan []byte) *ChanLogger
func (*ChanLogger) ClearAllLogFile ¶
func (that *ChanLogger) ClearAllLogFile() error
func (*ChanLogger) ClearCurLogFile ¶
func (that *ChanLogger) ClearCurLogFile() error
func (*ChanLogger) Close ¶
func (that *ChanLogger) Close() error
func (*ChanLogger) ReadTailLog ¶
func (*ChanLogger) SetPid ¶
func (that *ChanLogger) SetPid(_ int)
type FileLogger ¶
type FileLogger struct {
// contains filtered or unexported fields
}
FileLogger 写入stdout/stderr到文件
func NewFileLogger ¶
func (*FileLogger) ClearAllLogFile ¶
func (that *FileLogger) ClearAllLogFile() error
ClearAllLogFile 清除所有日志文件,包括保留的备份
func (*FileLogger) ClearCurLogFile ¶
func (that *FileLogger) ClearCurLogFile() error
ClearCurLogFile 清除当前日志文件
func (*FileLogger) ReadLog ¶
func (that *FileLogger) ReadLog(offset int64, length int64) (string, error)
ReadLog 读取日志
func (*FileLogger) ReadTailLog ¶
ReadTailLog 读取尾部日志
func (*FileLogger) SetPid ¶
func (that *FileLogger) SetPid(pid int)
type Logger ¶
type Logger interface { io.WriteCloser SetPid(pid int) ReadLog(offset int64, length int64) (string, error) ReadTailLog(offset int64, length int64) (string, int64, bool, error) ClearCurLogFile() error ClearAllLogFile() error }
Logger 日志的接口
type MultiLogger ¶
type MultiLogger struct {
// contains filtered or unexported fields
}
func NewMultiLogger ¶
func NewMultiLogger(loggers []Logger) *MultiLogger
func (*MultiLogger) AddLogger ¶
func (that *MultiLogger) AddLogger(logger Logger)
func (*MultiLogger) ClearAllLogFile ¶
func (that *MultiLogger) ClearAllLogFile() error
ClearAllLogFile clear all the files of first logger in MultiLogger pool
func (*MultiLogger) ClearCurLogFile ¶
func (that *MultiLogger) ClearCurLogFile() error
ClearCurLogFile clear the first logger file in MultiLogger pool
func (*MultiLogger) Close ¶
func (that *MultiLogger) Close() (err error)
func (*MultiLogger) ReadLog ¶
func (that *MultiLogger) ReadLog(offset int64, length int64) (string, error)
ReadLog read log data from first logger in MultiLogger pool
func (*MultiLogger) ReadTailLog ¶
ReadTailLog tail the log data from first logger in MultiLogger pool
func (*MultiLogger) RemoveLogger ¶
func (that *MultiLogger) RemoveLogger(logger Logger)
func (*MultiLogger) SetPid ¶
func (that *MultiLogger) SetPid(pid int)
type NullLocker ¶
type NullLocker struct{}
NullLocker 假锁
func NewNullLocker ¶
func NewNullLocker() *NullLocker
func (*NullLocker) Lock ¶
func (that *NullLocker) Lock()
func (*NullLocker) Unlock ¶
func (that *NullLocker) Unlock()
type NullLogger ¶
type NullLogger struct { }
func NewNullLogger ¶
func NewNullLogger() *NullLogger
func (*NullLogger) ClearAllLogFile ¶
func (that *NullLogger) ClearAllLogFile() error
func (*NullLogger) ClearCurLogFile ¶
func (that *NullLogger) ClearCurLogFile() error
func (*NullLogger) Close ¶
func (that *NullLogger) Close() error
func (*NullLogger) ReadLog ¶
func (that *NullLogger) ReadLog(offset int64, length int64) (string, error)
func (*NullLogger) ReadTailLog ¶
func (*NullLogger) SetPid ¶
func (that *NullLogger) SetPid(pid int)
type StdLogger ¶
type StdLogger struct { NullLogger // contains filtered or unexported fields }
func NewStderrLogger ¶
func NewStderrLogger() *StdLogger
func NewStdoutLogger ¶
func NewStdoutLogger() *StdLogger
type SysLogger ¶
type SysLogger struct { NullLogger // contains filtered or unexported fields }
func NewRemoteSysLogger ¶
NewRemoteSysLogger 获取远程系统日志的对象
func NewSysLogger ¶
NewSysLogger 获取系统syslog的对象
Click to show internal directories.
Click to hide internal directories.