Documentation ¶
Index ¶
- Variables
- func Critical(v ...interface{})
- func Criticalf(format string, params ...interface{})
- func Debug(v ...interface{})
- func Debugf(format string, params ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, params ...interface{})
- func Flush()
- func Info(v ...interface{})
- func Infof(format string, params ...interface{})
- func SetLogger(l Logger)
- func Trace(v ...interface{})
- func Tracef(format string, params ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, params ...interface{})
- type Logger
- type ThrottledLogger
Constants ¶
This section is empty.
Variables ¶
var NoopLogger = noopLogger{}
NoopLogger is a logger which has no effect upon calling.
Functions ¶
func Critical ¶
func Critical(v ...interface{})
Critical formats message using the default formats for its operands and writes to log with level = Critical
func Criticalf ¶
func Criticalf(format string, params ...interface{})
Criticalf formats message according to format specifier and writes to log with level = Critical.
func Debug ¶
func Debug(v ...interface{})
Debug formats message using the default formats for its operands and writes to log with level = Debug
func Debugf ¶
func Debugf(format string, params ...interface{})
Debugf formats message according to format specifier and writes to log with level = Debug.
func Error ¶
func Error(v ...interface{})
Error formats message using the default formats for its operands and writes to log with level = Error
func Errorf ¶
func Errorf(format string, params ...interface{})
Errorf formats message according to format specifier and writes to log with level = Error.
func Info ¶
func Info(v ...interface{})
Info formats message using the default formats for its operands and writes to log with level = Info
func Infof ¶
func Infof(format string, params ...interface{})
Infof formats message according to format specifier and writes to log with level = Info.
func Trace ¶
func Trace(v ...interface{})
Trace formats message using the default formats for its operands and writes to log with level = Trace
func Tracef ¶
func Tracef(format string, params ...interface{})
Tracef formats message according to format specifier and writes to log with level = Trace.
Types ¶
type Logger ¶
type Logger interface { Trace(v ...interface{}) Tracef(format string, params ...interface{}) Debug(v ...interface{}) Debugf(format string, params ...interface{}) Info(v ...interface{}) Infof(format string, params ...interface{}) Warn(v ...interface{}) error Warnf(format string, params ...interface{}) error Error(v ...interface{}) error Errorf(format string, params ...interface{}) error Critical(v ...interface{}) error Criticalf(format string, params ...interface{}) error Flush() }
Logger implements the core logger interface.
func NewBufferLogger ¶
NewBufferLogger creates a new Logger which outputs everything to the given buffer.
type ThrottledLogger ¶
type ThrottledLogger struct {
// contains filtered or unexported fields
}
ThrottledLogger limits the number of log calls during a time window. To create a new logger use NewThrottled.
func NewThrottled ¶
func NewThrottled(n int, d time.Duration) *ThrottledLogger
NewThrottled returns a new throttled logger. The returned logger will allow up to n calls in a time period of length d.
func (*ThrottledLogger) Error ¶
func (tl *ThrottledLogger) Error(format string, params ...interface{})
Error logs the message at the error level.
func (*ThrottledLogger) Warn ¶
func (tl *ThrottledLogger) Warn(format string, params ...interface{})
Warn logs the message at the warning level.