Logrus
Hooks for logrus logging
Install / Use
/learn @onrik/LogrusREADME
Hooks for logrus
Example
package main
import (
"fmt"
"github.com/onrik/logrus/filename"
"github.com/onrik/logrus/sentry"
log "github.com/sirupsen/logrus"
)
var (
dsn = "http://60a0257d7b5a429a8838e5f2ba873ec9@example.com/1"
)
func main() {
filenameHook := filename.NewHook()
filenameHook.Field = "custom_source_field" // Customize source field name
log.AddHook(filenameHook)
sentryHook, err := sentry.NewHook(sentry.Options{
Dsn: dsn,
}, log.PanicLevel, log.FatalLevel, log.ErrorLevel)
if err != nil {
log.Error(err)
return
}
defer sentryHook.Flush()
log.AddHook(sentryHook)
err = fmt.Errorf("test error")
log.WithError(err).Error("Dead beef")
}
Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
349.7kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
