<commit_before># Slack Hooks for Logrus <img src="http://i.imgur.com/hTeVwmJ.png" width="40" height="40" alt=":walrus:" class="emoji" title=":walrus:"/>
[![GoDoc](https://godoc.org/github.com/bluele/logrus_slack?status.png)](https://godoc.org/github.com/bluele/logrus_slack)

## Example

```go
package main

import (
	logrus "github.com/Sirupsen/logrus"
	"github.com/bluele/logrus_slack"
)

const (
	// slack webhook url
	hookURL = "<KEY>"
)

func main() {
	logrus.SetLevel(logrus.DebugLevel)

	logrus.AddHook(&logrus_slack.SlackHook{
		HookURL:        hookURL,
		AcceptedLevels: logrus_slack.LevelThreshold(logrus.WarnLevel),
		Channel:        "#general",
		IconEmoji:      ":ghost:",
		Username:       "logrus_slack",
	})

	logrus.WithFields(logrus.Fields{"foo": "bar", "foo2": "bar2"}).Warn("this is a warn level message")
	logrus.Debug("this is a debug level message")
	logrus.Info("this is an info level message")
	logrus.Error("this is an error level message")
}
```

## Install

```
$ go get -u github.com/bluele/logrus_slack
```

## Author

**<NAME>**

* <http://github.com/bluele>
* <<EMAIL>><commit_msg>add credits section to README.<commit_after># Slack Hooks for Logrus <img src="http://i.imgur.com/hTeVwmJ.png" width="40" height="40" alt=":walrus:" class="emoji" title=":walrus:"/>
[![GoDoc](https://godoc.org/github.com/bluele/logrus_slack?status.png)](https://godoc.org/github.com/bluele/logrus_slack)

## Example

```go
package main

import (
	logrus "github.com/Sirupsen/logrus"
	"github.com/bluele/logrus_slack"
)

const (
	// slack webhook url
	hookURL = "<KEY>"
)

func main() {
	logrus.SetLevel(logrus.DebugLevel)

	logrus.AddHook(&logrus_slack.SlackHook{
		HookURL:        hookURL,
		AcceptedLevels: logrus_slack.LevelThreshold(logrus.WarnLevel),
		Channel:        "#general",
		IconEmoji:      ":ghost:",
		Username:       "logrus_slack",
	})

	logrus.WithFields(logrus.Fields{"foo": "bar", "foo2": "bar2"}).Warn("this is a warn level message")
	logrus.Debug("this is a debug level message")
	logrus.Info("this is an info level message")
	logrus.Error("this is an error level message")
}
```

## Install

```
$ go get -u github.com/bluele/logrus_slack
```

## Credits 

This project based on [slackrus](https://github.com/johntdyer/slackrus)

## Author

**<NAME>**

* <http://github.com/bluele>
* <<EMAIL>>
{'fraction_non_alphanumeric': 0.1781880635465865, 'fraction_numerical': 0.005152425933877201, 'mean_word_length': 4.482352941176471, 'pattern_counts': {'":': 10, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4164408', 'n_tokens_mistral': 922, 'n_tokens_neox': 889, 'n_words': 163}