Documentation ¶
Index ¶
- Constants
- Variables
- func GetStack(size int) string
- func InitAccessLog(path string, level int) (err error)
- func InitAnalysisLog(path string, level int, bufferSize int) (err error)
- func InitErrorLog(path string, level int, bufferSize int) (err error)
- func InitLogger(errorlog, accesslog, analysislog string)
- type AccessLogHub
- type AnalysisLogHub
- type BufferLine
- type BufferLog
- type DemoHub
- type DemoHubConfig
- type ErrorLogHub
- type LogHub
- type Logger
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Logf(level int, format string, v ...interface{})
- func (l *Logger) SetLevel(level int)
- func (l *Logger) Warnf(format string, v ...interface{})
Constants ¶
View Source
const ( DEBUG = iota INFO WARN ERROR FATAL )
Variables ¶
View Source
var ( AccessLogFormat = "%s" AccessLogFlag = (log.Ldate | log.Ltime | log.Lmicroseconds) AccessLogger *Logger )
View Source
var ( AnalysisLogFormat = "%s" AnalysisLogFlag = log.LstdFlags | log.Lmicroseconds AnalysisLogger *Logger )
View Source
var ( ErrorLogFormat = "%s %15s:%4d - %s" ErrorLogFlag = (log.LstdFlags | log.Lmicroseconds) ErrorLogger *Logger )
Functions ¶
func InitAccessLog ¶
func InitLogger ¶
func InitLogger(errorlog, accesslog, analysislog string)
Types ¶
type AccessLogHub ¶
type AccessLogHub struct {
// contains filtered or unexported fields
}
func (*AccessLogHub) DumpBuffer ¶
func (hub *AccessLogHub) DumpBuffer(all bool, out io.Writer)
func (*AccessLogHub) GetLastLog ¶
func (hub *AccessLogHub) GetLastLog() []byte
func (*AccessLogHub) Reopen ¶
func (hub *AccessLogHub) Reopen(path string) (err error)
type AnalysisLogHub ¶
type AnalysisLogHub struct { BufferLog // contains filtered or unexported fields }
func (*AnalysisLogHub) Reopen ¶
func (hub *AnalysisLogHub) Reopen(path string) (err error)
type BufferLog ¶
type BufferLog struct { sync.Mutex Buffer []*BufferLine Last [FATAL + 1]*BufferLine // contains filtered or unexported fields }
func (*BufferLog) Add ¶
func (l *BufferLog) Add(line *BufferLine)
func (*BufferLog) GetLastLog ¶
func (*BufferLog) InitBuffer ¶
type DemoHub ¶
type DemoHub struct {
// contains filtered or unexported fields
}
func NewDemoHub ¶
func NewDemoHub() *DemoHub
func (*DemoHub) Bind ¶
func (l *DemoHub) Bind(name string, config *DemoHubConfig)
func (*DemoHub) GetLastLog ¶
type DemoHubConfig ¶
type DemoHubConfig struct {
// contains filtered or unexported fields
}
type ErrorLogHub ¶
type ErrorLogHub struct { BufferLog // contains filtered or unexported fields }
func (*ErrorLogHub) Reopen ¶
func (hub *ErrorLogHub) Reopen(path string) (err error)
Click to show internal directories.
Click to hide internal directories.