Golang log/syslog.Writer.Alert() function example
package log/syslog
Golang log/syslog.Writer.Alert() function usage example
package main
import (
"log"
"log/syslog"
)
func main() {
logWriter, err := syslog.New(syslog.LOG_ERR, "Socketloop Error!")
defer logWriter.Close()
if err != nil {
log.Fatal("error")
}
logWriter.Alert("alert")
logWriter.Write([]byte("Hello Logger!"))
}
Reference :
Advertisement
Something interesting
Tutorials
+7k Golang : Gargish-English language translator
+25.6k Golang : convert rune to integer value
+10.5k Swift : Convert (cast) String to Integer
+11.6k Golang : Display a text file line by line with line number example
+12.7k Golang : Send data to /dev/null a.k.a blackhole with ioutil.Discard
+25.8k Golang : Daemonizing a simple web server process example
+8.4k Golang : How to check if input string is a word?
+9.9k Golang : Check if user agent is a robot or crawler example
+11.7k Golang : Calculations using complex numbers example
+18.2k Golang : Get command line arguments
+9.7k Golang : interface - when and where to use examples
+16.5k Golang : Execute terminal command to remote machine example