Documentation ¶
Index ¶
- Constants
- func GetLogLevel() int
- func GetLogLevelByName(logName string) (int, error)
- func LogLevelToName(logLevel int) (string, error)
- func RegisterLogger(msgFunc MessageFunc)
- func SetGlobalLogLevel(level int)
- func SetGlobalQuietMode()
- type LoglevelCfg
- type MessageFunc
- type ReceptorLogger
- func (rl *ReceptorLogger) Debug(format string, v ...interface{})
- func (rl *ReceptorLogger) DebugPayload(payloadDebug int, payload string, workUnitID string, connectionType string)
- func (rl *ReceptorLogger) Error(format string, v ...interface{})
- func (rl *ReceptorLogger) GetLogLevel() int
- func (rl *ReceptorLogger) GetLogLevelByName(logName string) (int, error)
- func (rl *ReceptorLogger) GetPrefix() string
- func (rl *ReceptorLogger) Info(format string, v ...interface{})
- func (rl *ReceptorLogger) Log(level int, format string, v ...interface{})
- func (rl *ReceptorLogger) LogLevelToName(logLevel int) (string, error)
- func (rl *ReceptorLogger) SanitizedDebug(format string, v ...interface{})
- func (rl *ReceptorLogger) SanitizedError(format string, v ...interface{})
- func (rl *ReceptorLogger) SanitizedInfo(format string, v ...interface{})
- func (rl *ReceptorLogger) SanitizedLog(level int, format string, v ...interface{})
- func (rl *ReceptorLogger) SanitizedTrace(format string, v ...interface{})
- func (rl *ReceptorLogger) SanitizedWarning(format string, v ...interface{})
- func (rl *ReceptorLogger) SetOutput(w io.Writer)
- func (rl *ReceptorLogger) SetPrefix(prefix string)
- func (rl *ReceptorLogger) SetShowTrace(trace bool)
- func (rl *ReceptorLogger) Trace(format string, v ...interface{})
- func (rl *ReceptorLogger) Warning(format string, v ...interface{})
- type TraceCfg
Constants ¶
const ( ErrorLevel = iota + 1 WarningLevel InfoLevel DebugLevel )
Log level constants.
Variables ¶
This section is empty.
Functions ¶
func GetLogLevel ¶
func GetLogLevel() int
This doesn't seem to be used anywhere. GetLogLevel returns current log level.
func GetLogLevelByName ¶
GetLogLevelByName is a helper function for returning level associated with log level string.
func LogLevelToName ¶
LogLevelToName takes an int and returns the corresponding log level name.
func RegisterLogger ¶ added in v1.3.0
func RegisterLogger(msgFunc MessageFunc)
RegisterLogger registers a function for log delivery.
func SetGlobalLogLevel ¶ added in v1.4.0
func SetGlobalLogLevel(level int)
SetLogLevel is a helper function for setting logLevel int.
func SetGlobalQuietMode ¶ added in v1.4.0
func SetGlobalQuietMode()
QuietMode turns off all log output.
Types ¶
type LoglevelCfg ¶ added in v1.4.9
type LoglevelCfg struct {
Level string `description:"Log level: Error, Warning, Info or Debug" barevalue:"yes" default:"error"`
}
func (LoglevelCfg) Init ¶ added in v1.4.9
func (cfg LoglevelCfg) Init() error
type MessageFunc ¶ added in v1.3.0
type ReceptorLogger ¶ added in v1.4.0
func NewReceptorLogger ¶ added in v1.4.0
func NewReceptorLogger(prefix string) *ReceptorLogger
NewReceptorLogger to instantiate a new logger object.
func (*ReceptorLogger) Debug ¶ added in v1.4.0
func (rl *ReceptorLogger) Debug(format string, v ...interface{})
Debug contains extra information helpful to developers.
func (*ReceptorLogger) DebugPayload ¶ added in v1.4.9
func (rl *ReceptorLogger) DebugPayload(payloadDebug int, payload string, workUnitID string, connectionType string)
Debug payload data.
func (*ReceptorLogger) Error ¶ added in v1.4.0
func (rl *ReceptorLogger) Error(format string, v ...interface{})
Error reports unexpected behavior, likely to result in termination.
func (*ReceptorLogger) GetLogLevel ¶ added in v1.4.0
func (rl *ReceptorLogger) GetLogLevel() int
GetLogLevel returns the log level.
func (*ReceptorLogger) GetLogLevelByName ¶ added in v1.4.0
func (rl *ReceptorLogger) GetLogLevelByName(logName string) (int, error)
GetLogLevelByName is a helper function for returning level associated with log level string.
func (*ReceptorLogger) GetPrefix ¶ added in v1.4.0
func (rl *ReceptorLogger) GetPrefix() string
func (*ReceptorLogger) Info ¶ added in v1.4.0
func (rl *ReceptorLogger) Info(format string, v ...interface{})
Info provides general purpose statements useful to end user.
func (*ReceptorLogger) Log ¶ added in v1.4.0
func (rl *ReceptorLogger) Log(level int, format string, v ...interface{})
Log adds a prefix and prints a given log message.
func (*ReceptorLogger) LogLevelToName ¶ added in v1.4.0
func (rl *ReceptorLogger) LogLevelToName(logLevel int) (string, error)
LogLevelToName takes an int and returns the corresponding log level name.
func (*ReceptorLogger) SanitizedDebug ¶ added in v1.4.0
func (rl *ReceptorLogger) SanitizedDebug(format string, v ...interface{})
SanitizedDebug contains extra information helpful to developers.
func (*ReceptorLogger) SanitizedError ¶ added in v1.4.0
func (rl *ReceptorLogger) SanitizedError(format string, v ...interface{})
SanError reports unexpected behavior, likely to result in termination.
func (*ReceptorLogger) SanitizedInfo ¶ added in v1.4.0
func (rl *ReceptorLogger) SanitizedInfo(format string, v ...interface{})
SanitizedInfo provides general purpose statements useful to end user.
func (*ReceptorLogger) SanitizedLog ¶ added in v1.4.0
func (rl *ReceptorLogger) SanitizedLog(level int, format string, v ...interface{})
SanitizedLog adds a prefix and prints a given log message.
func (*ReceptorLogger) SanitizedTrace ¶ added in v1.4.0
func (rl *ReceptorLogger) SanitizedTrace(format string, v ...interface{})
SanitizedTrace outputs detailed packet traversal.
func (*ReceptorLogger) SanitizedWarning ¶ added in v1.4.0
func (rl *ReceptorLogger) SanitizedWarning(format string, v ...interface{})
SanitizedWarning reports unexpected behavior, not necessarily resulting in termination.
func (*ReceptorLogger) SetOutput ¶ added in v1.4.0
func (rl *ReceptorLogger) SetOutput(w io.Writer)
SetOutput sets the output destination for the logger.
func (*ReceptorLogger) SetPrefix ¶ added in v1.4.0
func (rl *ReceptorLogger) SetPrefix(prefix string)
func (*ReceptorLogger) SetShowTrace ¶ added in v1.4.0
func (rl *ReceptorLogger) SetShowTrace(trace bool)
SetShowTrace is a helper function for setting showTrace bool.
func (*ReceptorLogger) Trace ¶ added in v1.4.0
func (rl *ReceptorLogger) Trace(format string, v ...interface{})
Trace outputs detailed packet traversal.
func (*ReceptorLogger) Warning ¶ added in v1.4.0
func (rl *ReceptorLogger) Warning(format string, v ...interface{})
Warning reports unexpected behavior, not necessarily resulting in termination.