Documentation ¶
Overview ¶
Package Timer is timed contain, base on Time wheel algorithm.
the library of logging, can use global method(as Info, Debug, Warn, Error, Panic, Fatal) everywhere, also define a struct of Log implement the interface of Logger
the library of text color, set the color to text tag of message.
Index ¶
- Constants
- func Black(str string) string
- func Blue(str string) string
- func Cyan(str string) string
- func Debug(format string, a ...interface{})
- func Error(format string, a ...interface{})
- func Fatal(format string, a ...interface{})
- func Green(str string) string
- func Info(format string, a ...interface{})
- func Magenta(str string) string
- func Panic(format string, a ...interface{})
- func Red(str string) string
- func UcFirst(str string) string
- func Warn(format string, a ...interface{})
- func White(str string) string
- func Yellow(str string) string
- type BytePool
- type Log
- func (l *Log) Debug(format string, a ...interface{})
- func (l *Log) Error(format string, a ...interface{})
- func (l *Log) Fatal(format string, a ...interface{})
- func (l *Log) Info(format string, a ...interface{})
- func (l *Log) Panic(format string, a ...interface{})
- func (l *Log) Warn(format string, a ...interface{})
- type Logger
- type TaskID
- type Timer
Constants ¶
View Source
const ( // InfoLevel the default level of logging. InfoLevel = iota + 1 // DebugLevel the debug level of logging, usually use in development. DebugLevel // WarnLevel log the type of warn message. WarnLevel // ErrorLevel log the type of error message. ErrorLevel // PanicLevel log a message and panic. PanicLevel // FatalLevel log a message and call os.Exit(1). FatalLevel )
View Source
const ( TextBlack = iota + 30 TextRed TextGreen TextYellow TextBlue TextMagenta TextCyan TextWhite )
number value constant of color.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BytePool ¶
type BytePool struct {
// contains filtered or unexported fields
}
BytePool response the slice byte pool.
func NewBytesPool ¶
NewBytesPool return a bytes pool instance.
type Logger ¶
type Logger interface { // Info log the type of info message. Info(format string, a ...interface{}) // Debug log the type of Debug message. Debug(format string, a ...interface{}) // Warn log the type of warn message. Warn(format string, a ...interface{}) // Error log the type of error message. Error(format string, a ...interface{}) // Panic log a message and call panic. Panic(format string, a ...interface{}) // Fatal log a message and call os.Exit(1). Fatal(format string, a ...interface{}) }
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
Timer timed container.
Click to show internal directories.
Click to hide internal directories.