Golang log/syslog.New() function example
package log/syslog
Golang log/syslog.New() function usage example
package main
import (
"fmt"
"log/syslog"
)
func main() {
var wLogger *syslog.Writer
// syslog.LOG_CRIT is a priority
// see http://golang.org/pkg/log/syslog/#Priority for more example
wLogger, err := syslog.New(syslog.LOG_CRIT, "Critical error occured!")
fmt.Println(wLogger)
fmt.Println(err)
}
Reference :
Advertisement
Something interesting
Tutorials
+17k Golang : How to save log messages to file?
+52.6k Golang : How to get struct field and value by name
+11k Golang : Replace a parameter's value inside a configuration file example
+16.8k Golang : read gzipped http response
+7.6k Golang : Set horizontal, vertical scroll bars policies and disable interaction on Qt image
+25.6k Golang : convert rune to integer value
+22.7k Golang : Strings to lowercase and uppercase example
+30.4k Golang : Generate random string
+11.2k Google Maps URL parameters configuration
+18.4k Golang : How to remove certain lines from a file
+21.8k Golang : How to reverse slice or array elements order
+11.1k Golang : Simple image viewer with Go-GTK