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 MessageFunc
- type ReceptorLogger
- func (rl *ReceptorLogger) Debug(format string, v ...interface{})
- 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{})
Constants ¶
const ( ErrorLevel = iota + 1 WarningLevel InfoLevel DebugLevel )
Log level constants.
Variables ¶
This section is empty.
Functions ¶
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 ¶
func RegisterLogger(msgFunc MessageFunc)
RegisterLogger registers a function for log delivery.
func SetGlobalLogLevel ¶
func SetGlobalLogLevel(level int)
SetLogLevel is a helper function for setting logLevel int.
Types ¶
type MessageFunc ¶
type ReceptorLogger ¶
func NewReceptorLogger ¶
func NewReceptorLogger(prefix string) *ReceptorLogger
NewReceptorLogger to instantiate a new logger object.
func (*ReceptorLogger) Debug ¶
func (rl *ReceptorLogger) Debug(format string, v ...interface{})
Debug contains extra information helpful to developers.
func (*ReceptorLogger) Error ¶
func (rl *ReceptorLogger) Error(format string, v ...interface{})
Error reports unexpected behavior, likely to result in termination.
func (*ReceptorLogger) GetLogLevel ¶
func (rl *ReceptorLogger) GetLogLevel() int
GetLogLevel returns the log level.
func (*ReceptorLogger) GetLogLevelByName ¶
func (rl *ReceptorLogger) GetLogLevelByName(logName string) (int, error)
GetLogLevelByName is a helper function for returning level associated with log level string.
func (*ReceptorLogger) GetPrefix ¶
func (rl *ReceptorLogger) GetPrefix() string
func (*ReceptorLogger) Info ¶
func (rl *ReceptorLogger) Info(format string, v ...interface{})
Info provides general purpose statements useful to end user.
func (*ReceptorLogger) Log ¶
func (rl *ReceptorLogger) Log(level int, format string, v ...interface{})
Log adds a prefix and prints a given log message.
func (*ReceptorLogger) LogLevelToName ¶
func (rl *ReceptorLogger) LogLevelToName(logLevel int) (string, error)
LogLevelToName takes an int and returns the corresponding log level name.
func (*ReceptorLogger) SanitizedDebug ¶
func (rl *ReceptorLogger) SanitizedDebug(format string, v ...interface{})
SanitizedDebug contains extra information helpful to developers.
func (*ReceptorLogger) SanitizedError ¶
func (rl *ReceptorLogger) SanitizedError(format string, v ...interface{})
SanError reports unexpected behavior, likely to result in termination.
func (*ReceptorLogger) SanitizedInfo ¶
func (rl *ReceptorLogger) SanitizedInfo(format string, v ...interface{})
SanitizedInfo provides general purpose statements useful to end user.
func (*ReceptorLogger) SanitizedLog ¶
func (rl *ReceptorLogger) SanitizedLog(level int, format string, v ...interface{})
SanitizedLog adds a prefix and prints a given log message.
func (*ReceptorLogger) SanitizedTrace ¶
func (rl *ReceptorLogger) SanitizedTrace(format string, v ...interface{})
SanitizedTrace outputs detailed packet traversal.
func (*ReceptorLogger) SanitizedWarning ¶
func (rl *ReceptorLogger) SanitizedWarning(format string, v ...interface{})
SanitizedWarning reports unexpected behavior, not necessarily resulting in termination.
func (*ReceptorLogger) SetOutput ¶
func (rl *ReceptorLogger) SetOutput(w io.Writer)
SetOutput sets the output destination for the logger.
func (*ReceptorLogger) SetPrefix ¶
func (rl *ReceptorLogger) SetPrefix(prefix string)
func (*ReceptorLogger) SetShowTrace ¶
func (rl *ReceptorLogger) SetShowTrace(trace bool)
SetShowTrace is a helper function for setting showTrace bool.
func (*ReceptorLogger) Trace ¶
func (rl *ReceptorLogger) Trace(format string, v ...interface{})
Trace outputs detailed packet traversal.
func (*ReceptorLogger) Warning ¶
func (rl *ReceptorLogger) Warning(format string, v ...interface{})
Warning reports unexpected behavior, not necessarily resulting in termination.