Golang log.Print, Printf and Println functions example
package log
Golang log.Print, Printf and Println functions usage example
package main
import(
"log"
)
func main(){
log.Print("Log data : value is ", 2.3)
log.Printf("Log data : value is %f \n", 2.3)
log.Println("Log data : value is ", 2.3)
}
Output :
2015/03/26 15:06:24 Log data : value is 2.3
2015/03/26 15:06:24 Log data : value is 2.300000
2015/03/26 15:06:24 Log data : value is 2.3
References :
http://golang.org/pkg/log/#Print
Advertisement
Something interesting
Tutorials
+10.8k Golang : Natural string sorting example
+7.1k Nginx : How to block user agent ?
+6.2k PHP : Get client IP address
+29.5k Golang : Saving(serializing) and reading file with GOB
+25.3k Golang : Convert uint value to string type
+10.2k Golang : Random Rune generator
+32.2k Golang : Convert []string to []byte examples
+6k PageSpeed : Clear or flush cache on web server
+13.6k Golang : Query string with space symbol %20 in between
+7.7k Golang : Mapping Iban to Dunging alphabets
+6.9k Golang : Normalize email to prevent multiple signups example
+32.5k Golang : Copy directory - including sub-directories and files