Versions in this module Expand all Collapse all v0 v0.0.2 May 24, 2021 Changes in this version + const ChunkSize + const DefaultMaxReconnect + const DefaultReconnectDelay + const FieldKeyFile + const FieldKeyFunc + const FieldKeyLevel + const FieldKeyLogrusError + const FieldKeyMsg + const FieldKeyTime + var AllLevels = []Level + var DefaultLevel = LOG_INFO + var ErrorKey = "error" + func AddHook(hook Hook) + func Debug(args ...interface{}) + func DebugFn(fn LogFunction) + func Debugf(format string, args ...interface{}) + func Debugln(args ...interface{}) + func DeferExitHandler(handler func()) + func Error(args ...interface{}) + func ErrorFn(fn LogFunction) + func Errorf(format string, args ...interface{}) + func Errorln(args ...interface{}) + func Exit(code int) + func Fatal(args ...interface{}) + func FatalFn(fn LogFunction) + func Fatalf(format string, args ...interface{}) + func Fatalln(args ...interface{}) + func Info(args ...interface{}) + func InfoFn(fn LogFunction) + func Infof(format string, args ...interface{}) + func Infoln(args ...interface{}) + func IsLevelEnabled(level Level) bool + func Panic(args ...interface{}) + func PanicFn(fn LogFunction) + func Panicf(format string, args ...interface{}) + func Panicln(args ...interface{}) + func Print(args ...interface{}) + func PrintFn(fn LogFunction) + func Printf(format string, args ...interface{}) + func Println(args ...interface{}) + func RegisterExitHandler(handler func()) + func SetBufferPool(bp BufferPool) + func SetFormatter(formatter Formatter) + func SetLevel(level Level) + func SetOutput(out io.Writer) + func SetReportCaller(include bool) + func Trace(args ...interface{}) + func TraceFn(fn LogFunction) + func Tracef(format string, args ...interface{}) + func Traceln(args ...interface{}) + func Warn(args ...interface{}) + func WarnFn(fn LogFunction) + func Warnf(format string, args ...interface{}) + func Warning(args ...interface{}) + func WarningFn(fn LogFunction) + func Warningf(format string, args ...interface{}) + func Warningln(args ...interface{}) + func Warnln(args ...interface{}) + type BufferPool interface + Get func() *bytes.Buffer + Put func(*bytes.Buffer) + type CompressType int + const CompressGzip + const CompressNone + const CompressZlib + type Entry struct + Buffer *bytes.Buffer + Caller *runtime.Frame + Context context.Context + Data Fields + Level Level + Logger *Logger + Message string + Time time.Time + func NewEntry(logger *Logger) *Entry + func WithContext(ctx context.Context) *Entry + func WithError(err error) *Entry + func WithField(key string, value interface{}) *Entry + func WithFields(fields Fields) *Entry + func WithTime(t time.Time) *Entry + func (entry *Entry) Bytes() ([]byte, error) + func (entry *Entry) Debug(args ...interface{}) + func (entry *Entry) Debugf(format string, args ...interface{}) + func (entry *Entry) Debugln(args ...interface{}) + func (entry *Entry) Dup() *Entry + func (entry *Entry) Error(args ...interface{}) + func (entry *Entry) Errorf(format string, args ...interface{}) + func (entry *Entry) Errorln(args ...interface{}) + func (entry *Entry) Fatal(args ...interface{}) + func (entry *Entry) Fatalf(format string, args ...interface{}) + func (entry *Entry) Fatalln(args ...interface{}) + func (entry *Entry) Info(args ...interface{}) + func (entry *Entry) Infof(format string, args ...interface{}) + func (entry *Entry) Infoln(args ...interface{}) + func (entry *Entry) Log(level Level, args ...interface{}) + func (entry *Entry) Logf(level Level, format string, args ...interface{}) + func (entry *Entry) Logln(level Level, args ...interface{}) + func (entry *Entry) Panic(args ...interface{}) + func (entry *Entry) Panicf(format string, args ...interface{}) + func (entry *Entry) Panicln(args ...interface{}) + func (entry *Entry) Print(args ...interface{}) + func (entry *Entry) Printf(format string, args ...interface{}) + func (entry *Entry) Println(args ...interface{}) + func (entry *Entry) String() (string, error) + func (entry *Entry) Trace(args ...interface{}) + func (entry *Entry) Tracef(format string, args ...interface{}) + func (entry *Entry) Traceln(args ...interface{}) + func (entry *Entry) Warn(args ...interface{}) + func (entry *Entry) Warnf(format string, args ...interface{}) + func (entry *Entry) Warning(args ...interface{}) + func (entry *Entry) Warningf(format string, args ...interface{}) + func (entry *Entry) Warningln(args ...interface{}) + func (entry *Entry) Warnln(args ...interface{}) + func (entry *Entry) WithContext(ctx context.Context) *Entry + func (entry *Entry) WithError(err error) *Entry + func (entry *Entry) WithField(key string, value interface{}) *Entry + func (entry *Entry) WithFields(fields Fields) *Entry + func (entry *Entry) WithTime(t time.Time) *Entry + func (entry *Entry) Writer() *io.PipeWriter + func (entry *Entry) WriterLevel(level Level) *io.PipeWriter + func (entry Entry) HasCaller() (has bool) + type Ext1FieldLogger interface + Trace func(args ...interface{}) + Tracef func(format string, args ...interface{}) + Traceln func(args ...interface{}) + type FieldLogger interface + Debug func(args ...interface{}) + Debugf func(format string, args ...interface{}) + Debugln func(args ...interface{}) + Error func(args ...interface{}) + Errorf func(format string, args ...interface{}) + Errorln func(args ...interface{}) + Fatal func(args ...interface{}) + Fatalf func(format string, args ...interface{}) + Fatalln func(args ...interface{}) + Info func(args ...interface{}) + Infof func(format string, args ...interface{}) + Infoln func(args ...interface{}) + Panic func(args ...interface{}) + Panicf func(format string, args ...interface{}) + Panicln func(args ...interface{}) + Print func(args ...interface{}) + Printf func(format string, args ...interface{}) + Println func(args ...interface{}) + Warn func(args ...interface{}) + Warnf func(format string, args ...interface{}) + Warning func(args ...interface{}) + Warningf func(format string, args ...interface{}) + Warningln func(args ...interface{}) + Warnln func(args ...interface{}) + WithError func(err error) *Entry + WithField func(key string, value interface{}) *Entry + WithFields func(fields Fields) *Entry + type FieldMap map[fieldKey]string + type Fields map[string]interface + type Formatter interface + Format func(*Entry) ([]byte, error) + type GelfFormatter struct + func (f *GelfFormatter) Format(entry *Entry) ([]byte, error) + type GelfWriter struct + Facility string + func (w *GelfWriter) Close() error + type Hook interface + Fire func(*Entry) error + Levels func() []Level + type JSONFormatter struct + CallerPrettyfier func(*runtime.Frame) (function string, file string) + DataKey string + DisableHTMLEscape bool + DisableTimestamp bool + FieldMap FieldMap + PrettyPrint bool + TimestampFormat string + func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) + type Level uint32 + const DebugLevel + const ErrorLevel + const FatalLevel + const InfoLevel + const PanicLevel + const TraceLevel + const WarnLevel + func GetLevel() Level + func ParseLevel(lvl string) (Level, error) + func (level *Level) UnmarshalText(text []byte) error + func (level Level) MarshalText() ([]byte, error) + func (level Level) String() string + type LevelHooks map[Level][]Hook + func (hooks LevelHooks) Add(hook Hook) + func (hooks LevelHooks) Fire(level Level, entry *Entry) error + type LogFunction func() []interface + type Logger struct + BufferPool BufferPool + ExitFunc exitFunc + Formatter Formatter + Hooks LevelHooks + Level Level + Out io.Writer + ReportCaller bool + func New() *Logger + func StandardLogger() *Logger + func (logger *Logger) AddHook(hook Hook) + func (logger *Logger) Debug(args ...interface{}) + func (logger *Logger) DebugFn(fn LogFunction) + func (logger *Logger) Debugf(format string, args ...interface{}) + func (logger *Logger) Debugln(args ...interface{}) + func (logger *Logger) Error(args ...interface{}) + func (logger *Logger) ErrorFn(fn LogFunction) + func (logger *Logger) Errorf(format string, args ...interface{}) + func (logger *Logger) Errorln(args ...interface{}) + func (logger *Logger) Exit(code int) + func (logger *Logger) Fatal(args ...interface{}) + func (logger *Logger) FatalFn(fn LogFunction) + func (logger *Logger) Fatalf(format string, args ...interface{}) + func (logger *Logger) Fatalln(args ...interface{}) + func (logger *Logger) GetLevel() Level + func (logger *Logger) Info(args ...interface{}) + func (logger *Logger) InfoFn(fn LogFunction) + func (logger *Logger) Infof(format string, args ...interface{}) + func (logger *Logger) Infoln(args ...interface{}) + func (logger *Logger) IsLevelEnabled(level Level) bool + func (logger *Logger) Log(level Level, args ...interface{}) + func (logger *Logger) LogFn(level Level, fn LogFunction) + func (logger *Logger) Logf(level Level, format string, args ...interface{}) + func (logger *Logger) Logln(level Level, args ...interface{}) + func (logger *Logger) Panic(args ...interface{}) + func (logger *Logger) PanicFn(fn LogFunction) + func (logger *Logger) Panicf(format string, args ...interface{}) + func (logger *Logger) Panicln(args ...interface{}) + func (logger *Logger) Print(args ...interface{}) + func (logger *Logger) PrintFn(fn LogFunction) + func (logger *Logger) Printf(format string, args ...interface{}) + func (logger *Logger) Println(args ...interface{}) + func (logger *Logger) ReplaceHooks(hooks LevelHooks) LevelHooks + func (logger *Logger) SetBufferPool(pool BufferPool) + func (logger *Logger) SetFormatter(formatter Formatter) + func (logger *Logger) SetLevel(level Level) + func (logger *Logger) SetNoLock() + func (logger *Logger) SetOutput(output io.Writer) + func (logger *Logger) SetReportCaller(reportCaller bool) + func (logger *Logger) Trace(args ...interface{}) + func (logger *Logger) TraceFn(fn LogFunction) + func (logger *Logger) Tracef(format string, args ...interface{}) + func (logger *Logger) Traceln(args ...interface{}) + func (logger *Logger) Warn(args ...interface{}) + func (logger *Logger) WarnFn(fn LogFunction) + func (logger *Logger) Warnf(format string, args ...interface{}) + func (logger *Logger) Warning(args ...interface{}) + func (logger *Logger) WarningFn(fn LogFunction) + func (logger *Logger) Warningf(format string, args ...interface{}) + func (logger *Logger) Warningln(args ...interface{}) + func (logger *Logger) Warnln(args ...interface{}) + func (logger *Logger) WithContext(ctx context.Context) *Entry + func (logger *Logger) WithError(err error) *Entry + func (logger *Logger) WithField(key string, value interface{}) *Entry + func (logger *Logger) WithFields(fields Fields) *Entry + func (logger *Logger) WithTime(t time.Time) *Entry + func (logger *Logger) Writer() *io.PipeWriter + func (logger *Logger) WriterLevel(level Level) *io.PipeWriter + type Message struct + Env string + Extra map[string]interface{} + Facility string + Full string + Host string + Level float64 + LevelName string + RawExtra json.RawMessage + Service string + Short string + TimeUnix float64 + Version string + func (m *Message) MarshalJSONBuf(buf *bytes.Buffer) error + func (m *Message) UnmarshalJSON(data []byte) error + type MutexWrap struct + func (mw *MutexWrap) Disable() + func (mw *MutexWrap) Lock() + func (mw *MutexWrap) Unlock() + type Priority int + const LOG_CRIT + const LOG_DEBUG + const LOG_EMERG + const LOG_ERR + const LOG_INFO + const LOG_TRACE + const LOG_WARNING + type StdLogger interface + Fatal func(...interface{}) + Fatalf func(string, ...interface{}) + Fatalln func(...interface{}) + Panic func(...interface{}) + Panicf func(string, ...interface{}) + Panicln func(...interface{}) + Print func(...interface{}) + Printf func(string, ...interface{}) + Println func(...interface{}) + type TCPWriter struct + MaxReconnect int + ReconnectDelay time.Duration + func NewTCPWriter(addr string) (*TCPWriter, error) + func (w *TCPWriter) Write(p []byte) (n int, err error) + func (w *TCPWriter) WriteMessage(m *Message) (err error) + type TextFormatter struct + CallerPrettyfier func(*runtime.Frame) (function string, file string) + DisableColors bool + DisableLevelTruncation bool + DisableQuote bool + DisableSorting bool + DisableTimestamp bool + EnvironmentOverrideColors bool + FieldMap FieldMap + ForceColors bool + ForceQuote bool + FullTimestamp bool + PadLevelText bool + QuoteEmptyFields bool + SortingFunc func([]string) + TimestampFormat string + func (f *TextFormatter) Format(entry *Entry) ([]byte, error) + type UDPWriter struct + CompressionLevel int + CompressionType CompressType + func NewUDPWriter(addr string) (*UDPWriter, error) + func (w *UDPWriter) Write(p []byte) (n int, err error) + func (w *UDPWriter) WriteMessage(m *Message) (err error) + type Writer interface + Close func() error + Write func([]byte) (int, error) + WriteMessage func(*Message) error