Documentation ¶
Index ¶
- Constants
- func AppendBytes(b []byte, elems ...[]byte) []byte
- func FileExist(path string) bool
- func FreeAsyncLogRoutine()
- func FreeBuffers()
- func InitAsyncLogRoutine(msgQueueLen int)
- func InitBufferAutoFlushRoutine(maxBufNum int, timeInterval time.Duration)
- func NewAsyncLogger(logger ILogger) *asyncLogger
- func NewBuffer(w IWriter, bufsize int) *buffer
- func NewSimpleFormater() *simpleFormater
- func NewSimpleLogger(writer IWriter, globalLevel int, formater IFormater) (*simpleLogger, error)
- func NewWebFormater(logId, ip []byte) *webFormater
- func TimeGeneralLayout() string
- type ConsoleWriter
- type FileWithSplitWriter
- type FileWriter
- type IFormater
- type ILogger
- type IWriter
- type NoopFormater
- type NoopLogger
- func (this *NoopLogger) Alert(msg []byte)
- func (this *NoopLogger) Critical(msg []byte)
- func (this *NoopLogger) Debug(msg []byte)
- func (this *NoopLogger) Emergency(msg []byte)
- func (this *NoopLogger) Error(msg []byte)
- func (this *NoopLogger) Flush() error
- func (this *NoopLogger) Free()
- func (this *NoopLogger) Info(msg []byte)
- func (this *NoopLogger) Log(level int, msg []byte) error
- func (this *NoopLogger) Notice(msg []byte)
- func (this *NoopLogger) Warning(msg []byte)
- type NoopWriter
Constants ¶
View Source
const ( ASYNC_MSG_KIND_LOG = 1 ASYNC_MSG_KIND_FLUSH = 2 ASYNC_MSG_KIND_FREE_LOGGER = 3 ASYNC_MSG_KIND_FREE_ROUTINE = 4 )
View Source
const ( LEVEL_DEBUG = 1 LEVEL_INFO = 2 LEVEL_NOTICE = 3 LEVEL_WARNING = 4 LEVEL_ERROR = 5 LEVEL_CRITICAL = 6 LEVEL_ALERT = 7 LEVEL_EMERGENCY = 8 )
View Source
const ( SPLIT_BY_DAY = 1 SPLIT_BY_HOUR = 2 )
View Source
const ( TIME_FMT_STR_YEAR = "2006" TIME_FMT_STR_MONTH = "01" TIME_FMT_STR_DAY = "02" TIME_FMT_STR_HOUR = "15" TIME_FMT_STR_MINUTE = "04" TIME_FMT_STR_SECOND = "05" )
Variables ¶
This section is empty.
Functions ¶
func AppendBytes ¶
func FreeAsyncLogRoutine ¶
func FreeAsyncLogRoutine()
func FreeBuffers ¶
func FreeBuffers()
func InitBufferAutoFlushRoutine ¶
must be called first
func NewAsyncLogger ¶
func NewAsyncLogger(logger ILogger) *asyncLogger
func NewSimpleFormater ¶
func NewSimpleFormater() *simpleFormater
func NewSimpleLogger ¶
func NewWebFormater ¶
func NewWebFormater(logId, ip []byte) *webFormater
func TimeGeneralLayout ¶
func TimeGeneralLayout() string
Types ¶
type ConsoleWriter ¶ added in v1.1.0
func NewStderrWriter ¶ added in v1.1.0
func NewStderrWriter() *ConsoleWriter
func NewStdoutWriter ¶ added in v1.1.0
func NewStdoutWriter() *ConsoleWriter
func (*ConsoleWriter) Flush ¶ added in v1.1.0
func (this *ConsoleWriter) Flush() error
func (*ConsoleWriter) Free ¶ added in v1.1.0
func (this *ConsoleWriter) Free()
type FileWithSplitWriter ¶
type FileWithSplitWriter struct { *FileWriter // contains filtered or unexported fields }
func NewFileWriterWithSplit ¶
func NewFileWriterWithSplit(path string, split int) (*FileWithSplitWriter, error)
type FileWriter ¶
func NewFileWriter ¶
func NewFileWriter(path string) (*FileWriter, error)
func (*FileWriter) CloseOnFree ¶
func (this *FileWriter) CloseOnFree(closeOneFree bool) *FileWriter
func (*FileWriter) Flush ¶
func (this *FileWriter) Flush() error
func (*FileWriter) Free ¶
func (this *FileWriter) Free()
type NoopFormater ¶
type NoopFormater struct { }
type NoopLogger ¶
type NoopLogger struct { }
func (*NoopLogger) Alert ¶
func (this *NoopLogger) Alert(msg []byte)
func (*NoopLogger) Critical ¶
func (this *NoopLogger) Critical(msg []byte)
func (*NoopLogger) Debug ¶
func (this *NoopLogger) Debug(msg []byte)
func (*NoopLogger) Emergency ¶
func (this *NoopLogger) Emergency(msg []byte)
func (*NoopLogger) Error ¶
func (this *NoopLogger) Error(msg []byte)
func (*NoopLogger) Flush ¶
func (this *NoopLogger) Flush() error
func (*NoopLogger) Free ¶
func (this *NoopLogger) Free()
func (*NoopLogger) Info ¶
func (this *NoopLogger) Info(msg []byte)
func (*NoopLogger) Notice ¶
func (this *NoopLogger) Notice(msg []byte)
func (*NoopLogger) Warning ¶
func (this *NoopLogger) Warning(msg []byte)
type NoopWriter ¶
type NoopWriter struct { }
func (*NoopWriter) Flush ¶
func (this *NoopWriter) Flush() error
func (*NoopWriter) Free ¶
func (this *NoopWriter) Free()
Click to show internal directories.
Click to hide internal directories.