Documentation ¶
Index ¶
- type StackdriverHook
- func (h *StackdriverHook) AddErrorHandler(fn func(entry *logrus.Entry, err error))
- func (h *StackdriverHook) AddFilter(name string, fn func(interface{}) interface{})
- func (h *StackdriverHook) AddIgnore(name string)
- func (h *StackdriverHook) Async()
- func (h *StackdriverHook) Fire(entry *logrus.Entry) error
- func (h *StackdriverHook) Levels() []logrus.Level
- func (h *StackdriverHook) SetLabels(labels map[string]string)
- func (h *StackdriverHook) SetLevels(levels []logrus.Level)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StackdriverHook ¶
type StackdriverHook struct {
// contains filtered or unexported fields
}
StackdriverHook is logrus hook for Google Stackdriver.
func New ¶
func New(projectID string, logName string) (*StackdriverHook, error)
New returns initialized logrus hook for Stackdriver.
func NewWithConfig ¶
NewWithConfig returns initialized logrus hook for Stackdriver.
func (*StackdriverHook) AddErrorHandler ¶ added in v0.2.2
func (h *StackdriverHook) AddErrorHandler(fn func(entry *logrus.Entry, err error))
AddFilter adds a error handler function used when Stackdriver returns error.
func (*StackdriverHook) AddFilter ¶
func (h *StackdriverHook) AddFilter(name string, fn func(interface{}) interface{})
AddFilter adds a custom filter function.
func (*StackdriverHook) AddIgnore ¶
func (h *StackdriverHook) AddIgnore(name string)
AddIgnore adds field name to ignore.
func (*StackdriverHook) Async ¶
func (h *StackdriverHook) Async()
Async sets async flag and send log asynchroniously. If use this option, Fire() does not return error.
func (*StackdriverHook) Fire ¶
func (h *StackdriverHook) Fire(entry *logrus.Entry) error
Fire is invoked by logrus and sends log to Stackdriver.
func (*StackdriverHook) Levels ¶
func (h *StackdriverHook) Levels() []logrus.Level
Levels returns logging level to fire this hook.
func (*StackdriverHook) SetLabels ¶
func (h *StackdriverHook) SetLabels(labels map[string]string)
SetLabels sets logging level to fire this hook.
func (*StackdriverHook) SetLevels ¶
func (h *StackdriverHook) SetLevels(levels []logrus.Level)
SetLevels sets logging level to fire this hook.