https://github.com/kcmerrill/snitchin.go
A multi channel log emitter(a clone of my php snitchin) written in GO
https://github.com/kcmerrill/snitchin.go
Last synced: 3 months ago
JSON representation
A multi channel log emitter(a clone of my php snitchin) written in GO
- Host: GitHub
- URL: https://github.com/kcmerrill/snitchin.go
- Owner: kcmerrill
- Created: 2016-01-02T19:53:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-03T06:14:38.000Z (over 9 years ago)
- Last Synced: 2025-01-26T17:11:20.979Z (4 months ago)
- Language: Go
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# snitchin-go
A multi channel log emitter(a clone of my php snitchin) written in GO# Basics
Create as many or as few channels as you want, each with their own logging levels. The best way to demonstrate it is via code.```
package mainimport (
log "github.com/kcmerrill/snitchin-go"
)func main() {
/* Log to a file */
log.CreateChannel("TOAFILE", 100, log.File("/tmp/logger.txt"), "basic")
/* Log to slack */
log.CreateChannel("SLACK", 700, log.Slack("https://hooks.slack.com/services/customslackwebhookurl"), "%%MSG%%")log.DEBUG("HELLO DEBUG!!")
log.INFO("hello worldzzzzz")
log.NOTICE("THIS IS A NOTICE")
log.WARNING("THIS IS A WARNING")
log.ERROR("an error would go here")
log.CRITICAL("this would be a critical, or would it be?")
log.EMERGENCY("An emergency? Yes ... yes it is ..")
log.ALERT("this is an alert!")/* If you only want to log to a specific channel, Also, notice the dynamic channel name */
log.Channel("SECURITY").Log("ALERT", "My message would go here")/* Notice the custom log level */
log.Channel("SECURITY").Log("CUSTOMLOGLEVEL", "My message would go here")
}```