Documentation ¶
Index ¶
- func GetHostname(hostname string) (string, error)
- func LogName(pluginType, name, alias string) string
- func Prettify(i interface{}) string
- func SanitizeMetric(s string) string
- func SanitizeTag(s string) string
- func SanitizeTags(tags []string) []string
- func SetLoggerOnPlugin(i interface{}, log api.Logger)
- func SleepContext(ctx context.Context, duration time.Duration) error
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) OnErr(f func())
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHostname ¶
TODO: get hostname from command
func Prettify ¶
func Prettify(i interface{}) string
Prettify returns the string representation of a value.
func SanitizeMetric ¶
func SanitizeTag ¶
func SanitizeTags ¶
func SetLoggerOnPlugin ¶
Types ¶
type Logger ¶
type Logger struct { OnErrs []func() Name string // Name is the plugin name, will be printed in the `[]`. }
Logger defines a logging structure for plugins.
func (*Logger) Debug ¶
func (l *Logger) Debug(args ...interface{})
Debug logs a debug message, patterned after klog.Info.
func (*Logger) Error ¶
func (l *Logger) Error(args ...interface{})
Error logs an error message, patterned after klog.Info.
func (*Logger) Info ¶
func (l *Logger) Info(args ...interface{})
Info logs an information message, patterned after klog.Info.
func (*Logger) OnErr ¶
func (l *Logger) OnErr(f func())
OnErr defines a callback that triggers only when errors are about to be written to the log
Click to show internal directories.
Click to hide internal directories.