https://github.com/dragon3/logrus-typetalk-hook
Typetalk Hook for Logrus
https://github.com/dragon3/logrus-typetalk-hook
go logging logrus
Last synced: 7 days ago
JSON representation
Typetalk Hook for Logrus
- Host: GitHub
- URL: https://github.com/dragon3/logrus-typetalk-hook
- Owner: dragon3
- License: mit
- Created: 2015-06-24T23:06:41.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-09-15T16:26:44.000Z (almost 9 years ago)
- Last Synced: 2025-05-19T10:01:41.042Z (about 1 year ago)
- Topics: go, logging, logrus
- Language: Go
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
logrus-typetalk-hook
========
[Typetalk](https://typetalk.com) hook for [Logrus](https://github.com/sirupsen/logrus).
## Use
```go
package main
import (
logrus "github.com/sirupsen/logrus"
"github.com/dragon3/logrus-typetalk-hook"
)
func main() {
logrus.AddHook(&typetalk.TypetalkHook{
BotURL: "https://typetalk.com/api/v1/topics/000?typetalkToken=abcdefghijklmnopqrstuvwxyz",
AcceptedLevels: typetalk.LevelThreshold(logrus.DebugLevel),
})
logrus.Warn("warn")
logrus.Info("info")
logrus.Debug("debug")
}
```
## Parameters
#### Required
* ```BotURL``` :
You can add a Bot from "Edit topic" and get BotURL from "Get or post messages URL" ( see: https://nulab-inc.com/blog/typetalk/typetalk-update-create-bots-easily-use-webhook/ )
## Installation
go get github.com/dragon3/logrus-typetalk-hook
## Credits
Based on hipchat handler by [nuboLAB](https://github.com/nubo/hiprus) and slack handler by [John Dyer](https://github.com/johntdyer/slackrus)