Documentation ¶
Index ¶
- Constants
- Variables
- func ClearSubscribers(g event.SubscriberGroup)
- func Critical(l Logger, msg string, fields ...interface{})
- func Criticalf(l Logger, msg string, fields ...interface{})
- func Debug(l Logger, msg string, fields ...interface{})
- func Debugf(l Logger, msg string, fields ...interface{})
- func Error(l Logger, msg string, fields ...interface{})
- func Errorf(l Logger, msg string, fields ...interface{})
- func Info(l Logger, msg string, fields ...interface{})
- func Infof(l Logger, msg string, fields ...interface{})
- func RemoveSubscriber(g event.SubscriberGroup, ids ...string) error
- func ReplaceString(origin, replacer string) string
- func Stack() interface{}
- func Subscriber(g event.SubscriberGroup, fn func(...interface{})) (event.Subscriber, error)
- func ToLevelName(lvl Level) string
- func Warn(l Logger, msg string, fields ...interface{})
- func Warnf(l Logger, msg string, fields ...interface{})
- type Caller
- type Event
- type FileSort
- type Level
- type Logger
- type MoveFileType
- type OptionChanWriter
- type OptionFileWriter
- func FileWiterBuffer(buffer int) OptionFileWriter
- func FileWiterFileName(name string) OptionFileWriter
- func FileWiterLevel(lvl Level) OptionFileWriter
- func FileWiterMaxBackupFile(num int) OptionFileWriter
- func FileWiterMaxLength(length int64) OptionFileWriter
- func FileWiterMoveFileType(typ MoveFileType) OptionFileWriter
- func FileWiterRoutings(num int) OptionFileWriter
- func FileWiterSeparator(separator string) OptionFileWriter
- type Writer
Constants ¶
View Source
const ( MinLevel = Level(iota) DebugLevel InfoLevel WarnLevel ErrorLevel CriticalLevel LevelNameUnknown = "Unknown" LevelNameDebug = "DEBU" LevelNameInfo = "INFO" LevelNameWarn = "WARN" LevelNameError = "ERRO" LevelNameCritical = "CRIT" )
define levels
Variables ¶
View Source
var LevelColors = map[Level]string{ DebugLevel: levelColorDebug, InfoLevel: levelColorInfo, WarnLevel: levelColorWarn, ErrorLevel: levelColorError, CriticalLevel: levelColorCritical, }
LevelColors printer's color
Functions ¶
func RemoveSubscriber ¶
func RemoveSubscriber(g event.SubscriberGroup, ids ...string) error
RemoveSubscriber 删除个人的操作函数
func Subscriber ¶
func Subscriber(g event.SubscriberGroup, fn func(...interface{})) (event.Subscriber, error)
Subscriber 注册个人的操作函数
Types ¶
type Logger ¶
type Logger interface { Debug(msg string, fields ...interface{}) Debugf(msg string, fields ...interface{}) Info(msg string, fields ...interface{}) Infof(msg string, fields ...interface{}) Warn(msg string, fields ...interface{}) Warnf(msg string, fields ...interface{}) Error(msg string, fields ...interface{}) Errorf(msg string, fields ...interface{}) Critical(msg string, fields ...interface{}) Criticalf(msg string, fields ...interface{}) With(params ...interface{}) Logger WithPrefix(prefixes ...interface{}) Logger event.SubscriberGroup }
Logger 日志对象
type MoveFileType ¶
type MoveFileType int
MoveFileType move file type
const ( MoveFileTypeNothing MoveFileType = iota // 不移动 MoveFileTypePerMinite // 按分钟移动 MoveFileTypeHourly // 按小时移动 MoveFileTypeDaily // 按天移动 )
MoveFileTypes
type OptionChanWriter ¶
type OptionChanWriter func(*chanWriter)
OptionChanWriter 操作配置函数
func ChanWiterSeparator ¶
func ChanWiterSeparator(separator string) OptionChanWriter
ChanWiterSeparator 设置打印分隔符
type OptionFileWriter ¶
type OptionFileWriter func(*fileWriterOptions)
OptionFileWriter 操作配置函数
func FileWiterFileName ¶
func FileWiterFileName(name string) OptionFileWriter
FileWiterFileName 设置文件名
func FileWiterMaxBackupFile ¶
func FileWiterMaxBackupFile(num int) OptionFileWriter
FileWiterMaxBackupFile 文件最大数量
func FileWiterMaxLength ¶
func FileWiterMaxLength(length int64) OptionFileWriter
FileWiterMaxLength 设置最大文件大小
func FileWiterMoveFileType ¶
func FileWiterMoveFileType(typ MoveFileType) OptionFileWriter
FileWiterMoveFileType 设置移动文件的类型
func FileWiterRoutings ¶
func FileWiterRoutings(num int) OptionFileWriter
FileWiterRoutings 设置Gouting数量
func FileWiterSeparator ¶
func FileWiterSeparator(separator string) OptionFileWriter
FileWiterSeparator 设置打印分隔符
type Writer ¶
type Writer interface { event.Subscriber }
Writer 写对象
func ChanWriter ¶
func ChanWriter(log Logger, opts ...OptionChanWriter) (Writer, error)
ChanWriter 标准窗体的输出对象
func FileWriter ¶
func FileWriter(log Logger, opts ...OptionFileWriter) (Writer, error)
FileWriter 标准窗体的输出对象
Source Files ¶
Click to show internal directories.
Click to hide internal directories.