Versions in this module Expand all Collapse all v1 v1.1.1 Apr 26, 2021 v1.1.0 Apr 23, 2021 Changes in this version + var DefaultBufSize = 10 type AliLogHubWriter + func NewAliLogHubWriterWithLevel(level int, conf *ConfAliLogHubWriter) *AliLogHubWriter type ConfAliLogHubWriter + LogStoreName string + Source string + Topic string type ConfFileWriter + PathPattern string v1.0.2 May 28, 2020 Changes in this version type KafKaMSGFields + PublicIP string v1.0.1 May 27, 2020 v1.0.0 May 27, 2020 Changes in this version + var LevelFlags = [...]string type ConfAliLogHubWriter + Enable bool type ConfConsoleWriter + Enable bool type ConfFileWriter + Enable bool type ConfKafKaWriter + Enable bool + Version string type LogConfig + AliLogHubWriter ConfAliLogHubWriter v0 v0.0.1 Mar 29, 2019 Changes in this version + const DEBUG + const ERROR + const FATAL + const INFO + const WARNING + var GlobalLevel = DEBUG + var LEVEL_FLAGS = [...]string + func Close() + func Debug(fmt string, args ...interface{}) + func Error(fmt string, args ...interface{}) + func Fatal(fmt string, args ...interface{}) + func Info(fmt string, args ...interface{}) + func Register(w Writer) + func SetLayout(layout string) + func SetLevel(lvl int) + func SetupLog(lc LogConfig) (err error) + func SetupLogWithConf(file string) (err error) + func ShowFullPath(show bool) + func Warn(fmt string, args ...interface{}) + type AliLogHubWriter struct + func NewAliLogHubWriter(bufSize int) *AliLogHubWriter + func (w *AliLogHubWriter) Flush() error + func (w *AliLogHubWriter) Init() (err error) + func (w *AliLogHubWriter) SetAccessKey(accessKeyId, accessKeySecret string) + func (w *AliLogHubWriter) SetEndpoint(endpoint string) + func (w *AliLogHubWriter) SetLog(logName, logSource string) + func (w *AliLogHubWriter) SetProject(pName, sName string) + func (w *AliLogHubWriter) Write(r *Record) (err error) + type ConfAliLogHubWriter struct + AccessKeyId string + AccessKeySecret string + BufSize int + Endpoint string + Level string + LogName string + LogSource string + On bool + ProjectName string + StoreName string + type ConfConsoleWriter struct + Color bool + Level string + On bool + type ConfFileWriter struct + Level string + LogPath string + On bool + type ConfKafKaWriter struct + Brokers []string + BufferSize int + Debug bool + Key string + Level string + MSG KafKaMSGFields + On bool + ProducerReturnSuccesses bool + ProducerTimeout int64 + ProducerTopic string + SpecifyVersion bool + VersionStr string + type ConsoleWriter struct + func NewConsoleWriter() *ConsoleWriter + func NewConsoleWriterWithLevel(level int) *ConsoleWriter + func (w *ConsoleWriter) Init() error + func (w *ConsoleWriter) SetColor(c bool) + func (w *ConsoleWriter) Write(r *Record) error + type FileWriter struct + func NewFileWriter() *FileWriter + func NewFileWriterWithLevel(level int) *FileWriter + func (w *FileWriter) Flush() error + func (w *FileWriter) Init() error + func (w *FileWriter) Rotate() error + func (w *FileWriter) SetPathPattern(pattern string) error + func (w *FileWriter) Write(r *Record) error + type Flusher interface + Flush func() error + type KafKaMSGFields struct + Code string + ESIndex string + ExtraFields map[string]interface{} + Level string + Message string + Now int64 + ServerIP string + Timestamp string + type KafKaWriter struct + func NewKafKaWriter(conf *ConfKafKaWriter) *KafKaWriter + func NewKafKaWriterWithWriter(conf *ConfKafKaWriter, level int) *KafKaWriter + func (k *KafKaWriter) Init() error + func (k *KafKaWriter) Start() (err error) + func (k *KafKaWriter) Stop() + func (k *KafKaWriter) Write(r *Record) error + type LogConfig struct + AliLoghubWriter ConfAliLogHubWriter + ConsoleWriter ConfConsoleWriter + FileWriter ConfFileWriter + FullPath bool + KafKaWriter ConfKafKaWriter + Level string + type Logger struct + func NewLogger() *Logger + func (l *Logger) Close() + func (l *Logger) Debug(fmt string, args ...interface{}) + func (l *Logger) Error(fmt string, args ...interface{}) + func (l *Logger) Fatal(fmt string, args ...interface{}) + func (l *Logger) Info(fmt string, args ...interface{}) + func (l *Logger) Register(w Writer) + func (l *Logger) SetLayout(layout string) + func (l *Logger) SetLevel(lvl int) + func (l *Logger) Warn(fmt string, args ...interface{}) + type Record struct + func (r *Record) String() string + type Rotater interface + Rotate func() error + SetPathPattern func(string) error + type ShortRecord Record — darwin/amd64, js/wasm, linux/amd64 + func (r *ShortRecord) String() string + type SyslogWriter struct — darwin/amd64, js/wasm, linux/amd64 + func NewSyslogWriter() *SyslogWriter + func (w *SyslogWriter) Init() (err error) + func (w *SyslogWriter) SetAddr(addr string) + func (w *SyslogWriter) SetNetwork(network string) + func (w *SyslogWriter) SetTag(tag string) + func (w *SyslogWriter) Write(r *Record) (err error) + type Writer interface + Init func() error + Write func(*Record) error