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
+10.4k Golang : Generate random integer or float number
+10.1k Golang : Identifying Golang HTTP client request
+9k Golang : Populate or initialize struct with values example
+22.1k Golang : Match strings by wildcard patterns with filepath.Match() function
+11.5k Golang : Change date format to yyyy-mm-dd
+22.3k Golang : Read directory content with filepath.Walk()
+7.5k Golang : Shuffle strings array
+20.2k Golang : How to get own program name during runtime ?
+10.9k Golang : Create Temporary File
+6k Golang : How to verify input is rune?
+12.1k Golang : Sort and reverse sort a slice of runes
+11.6k Golang : Convert(cast) float to int