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
+13k Golang : Calculate elapsed years or months since a date
+22.4k Golang : How to read JPG(JPEG), GIF and PNG files ?
+14.2k Golang : syscall.Socket example
+5.6k PHP : Fix Call to undefined function curl_init() error
+17.1k Golang : Capture stdout of a child process and act according to the result
+18.1k Golang : Check if a directory exist or not
+9.1k Golang : Intercept and compare HTTP response code example
+21.1k Golang : Sort and reverse sort a slice of strings
+9.4k Golang : Apply Histogram Equalization to color images
+21.5k Golang : How to read float value from standard input ?
+51.4k Golang : Check if item is in slice/array