Documentation
¶
Index ¶
- Variables
- func AddTickerFunc(f TickerFunc)
- func Close()
- func Errorf(msg string, args ...interface{})
- func Infof(msg string, args ...interface{})
- func Initialize(logfile string) error
- func PushMetric(history *list.List, ev expvar.Var) string
- func Rotate()
- func SetLogLevel(level string) (ok bool)
- func Tracef(msg string, args ...interface{})
- func Warnf(msg string, args ...interface{})
- type Level
- type TickerFunc
Constants ¶
This section is empty.
Variables ¶
var ( // MaxLevel is the highest Level we will log (max TRACE, min ERROR) MaxLevel = TRACE )
Functions ¶
func AddTickerFunc ¶ added in v1.3.0
func AddTickerFunc(f TickerFunc)
AddTickerFunc adds a new function callback to the list of metrics TickerFuncs that get called each minute.
func Errorf ¶
func Errorf(msg string, args ...interface{})
Errorf logs a message to the 'standard' Logger (always), accepts format strings
func Infof ¶
func Infof(msg string, args ...interface{})
Infof logs a message to the 'standard' Logger if MaxLevel is >= INFO, accepts format strings
func Initialize ¶
Initialize logging. If logfile is equal to "stderr" or "stdout", then we will log to that output stream. Otherwise the specificed file will opened for writing, and all log data will be placed in it.
func PushMetric ¶ added in v1.3.0
PushMetric adds the metric to the end of the list and returns a comma separated string of the previous 61 entries. We return 61 instead of 60 (an hour) because the chart on the client tracks deltas between these values - there is nothing to compare the first value against.
func Rotate ¶
func Rotate()
Rotate closes the current log file, then reopens it. This gives an external log rotation system the opportunity to move the existing log file out of the way and have Inbucket create a new one.
func SetLogLevel ¶
SetLogLevel sets MaxLevel based on the provided string
Types ¶
type TickerFunc ¶ added in v1.3.0
type TickerFunc func()
TickerFunc is the type of metrics function accepted by AddTickerFunc