Documentation ¶
Overview ¶
Package slackrus provides a Slack hook for the logrus loggin package.
Index ¶
Constants ¶
View Source
const (
VERISON = "0.0.3"
)
Project version
Variables ¶
View Source
var AllLevels = []logrus.Level{ logrus.TraceLevel, logrus.DebugLevel, logrus.InfoLevel, logrus.WarnLevel, logrus.ErrorLevel, logrus.FatalLevel, logrus.PanicLevel, }
Supported log levels
Functions ¶
Types ¶
type Filter ¶
Filter is a filter applied to log entries to filter out any messages which are too noisy. The filter should return true if the message should be included, and false if not.
type SlackrusHook ¶
type SlackrusHook struct { // Messages with a log level not contained in this array // will not be dispatched. If nil, all messages will be dispatched. AcceptedLevels []logrus.Level // Filters are applied to messages to determine if any entry should not be send out. Filters []Filter HookURL string IconURL string Channel string IconEmoji string Username string Asynchronous bool Extra map[string]interface{} Disabled bool // SortFields if set to true will sort Fields before sending them to slack. By default they // are sorted in alphabetical order. For finer grained control, SortPriorities can be used. SortFields bool // SortPriorities if set will modify the straight alphabetical sort used when SortFields is set. // It is a map of field keys to sort priority, causing keys with higher priorities to appear first. // Any field field keys that do not appear in SortPriorities will appear after all those that do // and be sorted in alphabetical order. SortPriorities map[string]int }
SlackrusHook is a logrus Hook for dispatching messages to the specified channel on Slack.
func (*SlackrusHook) Fire ¶
func (sh *SlackrusHook) Fire(e *logrus.Entry) error
Fire - Sent event to slack
func (*SlackrusHook) Levels ¶
func (sh *SlackrusHook) Levels() []logrus.Level
Levels sets which levels to sent to slack
Click to show internal directories.
Click to hide internal directories.