Golang log.New() function example
package log
Golang log.New() function usage example
package main
import (
"log"
"os"
)
func main() {
logger := log.New(os.Stdout, "", log.LstdFlags)
value := 25
logger.Fatalf("Value is %d \n", value)
}
Output :
2015/03/26 15:57:29 Value is 25
exit status 1
Reference :
Advertisement
Something interesting
Tutorials
+16.6k Golang : Generate QR codes for Google Authenticator App and fix "Cannot interpret QR code" error
+4.9k Unix/Linux : secure copying between servers with SCP command examples
+19.1k Mac OSX : Homebrew and Golang
+18.5k Golang : Write file with io.WriteString
+5.6k PHP : Convert CSV to JSON with YQL example
+11.2k Golang : Calculate Relative Strength Index(RSI) example
+21.2k Golang : How to force compile or remove object files first before rebuild?
+8.8k Golang : HTTP Routing with Goji example
+10.7k Golang : Get currencies exchange rates example
+6.5k Elasticsearch : Shutdown a local node
+7.3k Golang : Fixing Gorilla mux http.FileServer() 404 problem
+39k Golang : How to iterate over a []string(array)