Documentation ¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func IsEnable() bool
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func Panicln(args ...interface{})
- func RegisterLogger(t LogFormatterType, l *Logger) *errorAVA.Error
- func Serializer(t serializerAVA.SerializerType) ([]byte, *errorAVA.Error)
- func SetEnable()
- func SetFormat(logFormatterType LogFormatterType) *errorAVA.Error
- func SetLevel(levelType LogLevelType) *errorAVA.Error
- func SetOutputConsole(output io.Writer)
- func SetOutputFile(filename string, maxSize int, maxBackups int, maxAge int, compress bool)
- func Trace(args ...interface{})
- func Tracef(format string, args ...interface{})
- func Traceln(args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warnln(args ...interface{})
- func With(key string, value interface{})
- func WithFields(fields logrus.Fields) *logrus.Entry
- type LogFormatterType
- type LogLevelType
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Debugln(args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Errorln(args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Fatalln(args ...interface{})
- func (l *Logger) GetFormat() LogFormatterType
- func (l *Logger) GetLevel() LogLevelType
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Infoln(args ...interface{})
- func (l *Logger) IsDisableColors() bool
- func (l *Logger) IsEnable() bool
- func (l *Logger) IsForceColors() bool
- func (l *Logger) IsValid() *errorAVA.Error
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(format string, args ...interface{})
- func (l *Logger) Panicln(args ...interface{})
- func (l *Logger) Reset()
- func (l *Logger) Serializer(t serializerAVA.SerializerType) ([]byte, *errorAVA.Error)
- func (l *Logger) SetEnable()
- func (l *Logger) SetFormat(logFormatterType LogFormatterType) *errorAVA.Error
- func (l *Logger) SetLevel(levelType LogLevelType) *errorAVA.Error
- func (l *Logger) SetOutputConsole(output io.Writer)
- func (l *Logger) SetOutputFile(filename string, maxSize int, maxBackups int, maxAge int, compress bool)
- func (l *Logger) Trace(args ...interface{})
- func (l *Logger) Tracef(format string, args ...interface{})
- func (l *Logger) Traceln(args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) Warnln(args ...interface{})
- func (l *Logger) With(key string, value interface{}) LoggerI
- func (l *Logger) WithFields(fields logrus.Fields) *logrus.Entry
- type LoggerI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterLogger ¶
func RegisterLogger(t LogFormatterType, l *Logger) *errorAVA.Error
func Serializer ¶
func Serializer(t serializerAVA.SerializerType) ([]byte, *errorAVA.Error)
func SetFormat ¶
func SetFormat(logFormatterType LogFormatterType) *errorAVA.Error
func SetLevel ¶
func SetLevel(levelType LogLevelType) *errorAVA.Error
func SetOutputConsole ¶
func SetOutputFile ¶
Types ¶
type LogFormatterType ¶
type LogFormatterType int32
LogFormatterType x ENUM( Text JSON ApacheCommonLog ApacheCombinedLog ApacheErrorLog RFC3164Log RFC5424Log CommonLogFileFormat Unknown )
const ( // LogFormatterTypeText is a LogFormatterType of type Text LogFormatterTypeText LogFormatterType = iota // LogFormatterTypeJSON is a LogFormatterType of type JSON LogFormatterTypeJSON // LogFormatterTypeApacheCommonLog is a LogFormatterType of type ApacheCommonLog LogFormatterTypeApacheCommonLog // LogFormatterTypeApacheCombinedLog is a LogFormatterType of type ApacheCombinedLog LogFormatterTypeApacheCombinedLog // LogFormatterTypeApacheErrorLog is a LogFormatterType of type ApacheErrorLog LogFormatterTypeApacheErrorLog // LogFormatterTypeRFC3164Log is a LogFormatterType of type RFC3164Log LogFormatterTypeRFC3164Log // LogFormatterTypeRFC5424Log is a LogFormatterType of type RFC5424Log LogFormatterTypeRFC5424Log // LogFormatterTypeCommonLogFileFormat is a LogFormatterType of type CommonLogFileFormat LogFormatterTypeCommonLogFileFormat // LogFormatterTypeUnknown is a LogFormatterType of type Unknown LogFormatterTypeUnknown )
func GetFormat ¶
func GetFormat() LogFormatterType
func ParseLogFormatterType ¶
func ParseLogFormatterType(name string) (LogFormatterType, *errorAVA.Error)
ParseLogFormatterType attempts to convert a string to a LogFormatterType
func (LogFormatterType) MarshalText ¶
func (x LogFormatterType) MarshalText() ([]byte, *errorAVA.Error)
MarshalText implements the text marshaller method
func (LogFormatterType) String ¶
func (x LogFormatterType) String() string
String implements the Stringer interface.
func (LogFormatterType) UnmarshalText ¶
func (x LogFormatterType) UnmarshalText(text []byte) (LogFormatterType, *errorAVA.Error)
UnmarshalText implements the text unmarshaller method
type LogLevelType ¶
type LogLevelType uint32
LogLevelType x ENUM( Panic // Panic level, highest level of severity. Logs and then calls panic with the message passed to debug, info, ... Fatal // Fatal level. Logs and then calls `logger.Exit(1)`. It will exit even if the logging level is set to Panic. Error // Error level. Logs. Used for errors that should definitely be noted. Warn // Warn level. Non-critical entries that deserve eyes. Info // Info level. General operational entries about what's going on inside the application. Debug // Debug level. Usually only enabled when debugging. Very verbose logging. Trace // Trace level. Designates finer-grained informational events than the debug. Unknown )
const ( // LogLevelTypePanic is a LogLevelType of type Panic // Panic level, highest level of severity. Logs and then calls panic with the message passed to debug, info, ... LogLevelTypePanic LogLevelType = iota // LogLevelTypeFatal is a LogLevelType of type Fatal // Fatal level. Logs and then calls `logger.Exit(1)`. It will exit even if the logging level is set to Panic. LogLevelTypeFatal // LogLevelTypeError is a LogLevelType of type Error // Error level. Logs. Used for errors that should definitely be noted. LogLevelTypeError // LogLevelTypeWarn is a LogLevelType of type Warn // Warn level. Non-critical entries that deserve eyes. LogLevelTypeWarn // LogLevelTypeInfo is a LogLevelType of type Info // Info level. General operational entries about what's going on inside the application. LogLevelTypeInfo // LogLevelTypeDebug is a LogLevelType of type Debug // Debug level. Usually only enabled when debugging. Very verbose logging. LogLevelTypeDebug // LogLevelTypeTrace is a LogLevelType of type Trace // Trace level. Designates finer-grained informational events than the debug. LogLevelTypeTrace // LogLevelTypeUnknown is a LogLevelType of type Unknown LogLevelTypeUnknown )
func GetLevel ¶
func GetLevel() LogLevelType
func ParseLogLevelType ¶
func ParseLogLevelType(name string) (LogLevelType, *errorAVA.Error)
ParseLogLevelType attempts to convert a string to a LogLevelType
func (LogLevelType) MarshalText ¶
func (x LogLevelType) MarshalText() ([]byte, *errorAVA.Error)
MarshalText implements the text marshaller method
func (LogLevelType) String ¶
func (x LogLevelType) String() string
String implements the Stringer interface.
func (LogLevelType) UnmarshalText ¶
func (x LogLevelType) UnmarshalText(text []byte) (LogLevelType, *errorAVA.Error)
UnmarshalText implements the text unmarshaller method
type Logger ¶
type Logger struct { Enable bool Level LogLevelType Formatter LogFormatterType Output struct { Console bool File bool } File *lumberjack.Logger Log *logrus.Logger Mux sync.Mutex }
func GetInstance ¶
func GetInstance() *Logger
func (*Logger) Debug ¶
func (l *Logger) Debug(args ...interface{})
debug logs a message at level debug on the standard logger.
func (*Logger) Debugln ¶
func (l *Logger) Debugln(args ...interface{})
debug logs a message at level debug on the standard logger.
func (*Logger) Error ¶
func (l *Logger) Error(args ...interface{})
err logs a message at level err on the standard logger.
func (*Logger) Errorln ¶
func (l *Logger) Errorln(args ...interface{})
err logs a message at level err on the standard logger.
func (*Logger) Fatal ¶
func (l *Logger) Fatal(args ...interface{})
Fatal logs a message at level Fatal on the standard logger.
func (*Logger) Fatalln ¶
func (l *Logger) Fatalln(args ...interface{})
Fatal logs a message at level Fatal on the standard logger.
func (*Logger) GetFormat ¶
func (l *Logger) GetFormat() LogFormatterType
func (*Logger) GetLevel ¶
func (l *Logger) GetLevel() LogLevelType
func (*Logger) Info ¶
func (l *Logger) Info(args ...interface{})
info logs a message at level info on the standard logger.
func (*Logger) Infoln ¶
func (l *Logger) Infoln(args ...interface{})
info logs a message at level info on the standard logger.
func (*Logger) IsDisableColors ¶
func (*Logger) IsForceColors ¶
func (*Logger) Panic ¶
func (l *Logger) Panic(args ...interface{})
Panic logs a message at level Panic on the standard logger.
func (*Logger) Panicln ¶
func (l *Logger) Panicln(args ...interface{})
Panic logs a message at level Panic on the standard logger.
func (*Logger) Serializer ¶
func (l *Logger) Serializer(t serializerAVA.SerializerType) ([]byte, *errorAVA.Error)
func (*Logger) SetFormat ¶
func (l *Logger) SetFormat(logFormatterType LogFormatterType) *errorAVA.Error
func (*Logger) SetOutputConsole ¶
SetOutput sets the logger output.
func (*Logger) SetOutputFile ¶
func (l *Logger) SetOutputFile(filename string, maxSize int, maxBackups int, maxAge int, compress bool)
SetOutput sets the logger output.
func (*Logger) Warn ¶
func (l *Logger) Warn(args ...interface{})
Warn logs a message at level Warn on the standard logger.
type LoggerI ¶
type LoggerI interface { Debug(...interface{}) Debugln(...interface{}) Debugf(string, ...interface{}) Trace(...interface{}) Traceln(...interface{}) Tracef(string, ...interface{}) Info(...interface{}) Infoln(...interface{}) Infof(string, ...interface{}) Warn(...interface{}) Warnln(...interface{}) Warnf(string, ...interface{}) Error(...interface{}) Errorln(...interface{}) Errorf(string, ...interface{}) Fatal(...interface{}) Fatalln(...interface{}) Fatalf(string, ...interface{}) Panic(...interface{}) Panicln(...interface{}) Panicf(format string, args ...interface{}) WithFields(logrus.Fields) *logrus.Entry With(key string, value interface{}) LoggerI SetOutputConsole(output io.Writer) SetOutputFile(filename string, maxSize int, maxBackups int, maxAge int, compress bool) SetFormat(logFormatterType LogFormatterType) *errorAVA.Error GetFormat() LogFormatterType IsEnable() bool SetEnable() SetLevel(levelType LogLevelType) *errorAVA.Error GetLevel() LogLevelType Reset() IsDisableColors() bool IsForceColors() bool Serializer(serializerAVA.SerializerType) ([]byte, *errorAVA.Error) }
logger is the interface for loggers used in the AVA components.