
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
github.com/SkYNewZ/slog-pushover
Advanced tools
A Pushover Handler for slog Go library. Inspired from samber' s slog repositories
go get github.com/SkYNewZ/slog-pushover
Compatibility: go >= 1.21
GoDoc: https://pkg.go.dev/github.com/skynewz/slog-pushover
type Options struct {
Level slog.Leveler // minimum level of messages to log (default: slog.LevelDebug)
Token string // Pushover application token
Recipient string // Pushover user/group key
Message *pushover.Message // optional: customize Pushover message. 'Message' will be replaced by the log message
Converter Converter // optional: customize Pushover message builder
// optional: see slog.HandlerOptions
AddSource bool
ReplaceAttr func(groups []string, a slog.Attr) slog.Attr
}
package main
func main() {
handler := slogpushover.NewHandler(&slogpushover.Options{
Level: slog.LevelDebug,
Token: os.Getenv("PUSHOVER_TOKEN"),
Recipient: os.Getenv("PUSHOVER_RECIPIENT"),
Message: nil, // You can customize the message details
Converter: nil,
AddSource: true,
ReplaceAttr: nil,
})
logger := slog.New(handler)
logger = logger.With("release", "v1.0.0")
logger.
With(
slog.Group("user",
slog.String("id", "user-123"),
slog.Time("created_at", time.Now().AddDate(0, 0, -1)),
),
).
With("environment", "dev").
With("error", fmt.Errorf("an error")).
Error("A message")
}
Copyright © 2023 Quentin Lemaire.
This project is MIT licensed.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.