Versions in this module Expand all Collapse all v0 v0.0.1 Apr 10, 2022 Changes in this version + const ASCIILineFeed + const ASCIINewLine + const ASCIISpace + const ASCIITab + var ErrInvalidLogLevelPattern = errors.New("un-parsable log level and pattern provided") + var ErrNilDisplayByteSliceHandler = errors.New("nil display byte slice handler") + var ErrNilFormatter = errors.New("nil formatter provided") + var ErrNilMarshalizer = errors.New("nil marshalizer") + var ErrNilWriter = errors.New("nil writer provided") + var ErrWriterNotFound = errors.New("writer not found while searching container") + var Levels = []LogLevel + func AddLogObserver(w io.Writer, formatter Formatter) error + func ClearLogObservers() + func DisplayByteSlice(slice []byte) string + func GetCorrelation() proto.LogCorrelationMessage + func GetLogLevelPattern() string + func GetOrCreate(name string) *logger + func IsEnabledCorrelation() bool + func IsEnabledLoggerName() bool + func NewLogLineWrapperFormatter(marshalizer Marshalizer) (*logLineWrapperFormatter, error) + func NewLogOutputSubject() *logOutputSubject + func NewLogger(name string, logLevel LogLevel, logOutput LogOutputHandler) *logger + func NewProfileChangeSubject() *profileChangeSubject + func NotifyProfileChange() + func RemoveLogObserver(w io.Writer) error + func SetCorrelationEpoch(epoch uint32) + func SetCorrelationRound(round int64) + func SetCorrelationShard(shardID string) + func SetCorrelationSubround(subRound string) + func SetDisplayByteSlice(f func(slice []byte) string) error + func SetLogLevel(logLevelAndPattern string) error + func SubscribeToProfileChange(observer ProfileChangeObserver) + func ToHex(slice []byte) string + func ToHexShort(slice []byte) string + func ToggleCorrelation(enable bool) + func ToggleLoggerName(enable bool) + func UnsubscribeFromProfileChange(observer ProfileChangeObserver) + type ConsoleFormatter struct + func (cf *ConsoleFormatter) IsInterfaceNil() bool + func (cf *ConsoleFormatter) Output(line LogLineHandler) []byte + type Formatter interface + IsInterfaceNil func() bool + Output func(line LogLineHandler) []byte + type LogLevel byte + const LogDebug + const LogError + const LogInfo + const LogNone + const LogTrace + const LogWarning + func GetLogLevel(logLevelAsString string) (LogLevel, error) + func GetLoggerLogLevel(loggerName string) LogLevel + func ParseLogLevelAndMatchingString(logLevelAndPatterns string) ([]LogLevel, []string, error) + func (level LogLevel) String() string + type LogLine struct + Args []interface{} + Correlation proto.LogCorrelationMessage + LogLevel LogLevel + LoggerName string + Message string + Timestamp time.Time + type LogLineHandler interface + GetArgs func() []string + GetCorrelation func() proto.LogCorrelationMessage + GetLogLevel func() int32 + GetLoggerName func() string + GetMessage func() string + GetTimestamp func() int64 + IsInterfaceNil func() bool + type LogLineWrapper struct + func (llw *LogLineWrapper) IsInterfaceNil() bool + type LogOutputHandler interface + AddObserver func(w io.Writer, format Formatter) error + ClearObservers func() + IsInterfaceNil func() bool + Output func(line *LogLine) + RemoveObserver func(w io.Writer) error + func GetLogOutputSubject() LogOutputHandler + type Logger interface + Debug func(message string, args ...interface{}) + Error func(message string, args ...interface{}) + GetLevel func() LogLevel + Info func(message string, args ...interface{}) + IsInterfaceNil func() bool + Log func(logLevel LogLevel, message string, args ...interface{}) + LogIfError func(err error, args ...interface{}) + LogLine func(line *LogLine) + SetLevel func(logLevel LogLevel) + Trace func(message string, args ...interface{}) + Warn func(message string, args ...interface{}) + type Marshalizer interface + IsInterfaceNil func() bool + Marshal func(obj interface{}) ([]byte, error) + Unmarshal func(obj interface{}, buff []byte) error + type PlainFormatter struct + func (pf *PlainFormatter) IsInterfaceNil() bool + func (pf *PlainFormatter) Output(line LogLineHandler) []byte + type Profile struct + LogLevelPatterns string + WithCorrelation bool + WithLoggerName bool + func GetCurrentProfile() Profile + func UnmarshalProfile(data []byte) (Profile, error) + func (profile *Profile) Apply() error + func (profile *Profile) Marshal() ([]byte, error) + func (profile *Profile) String() string + type ProfileChangeObserver interface + OnProfileChanged func()