log测试

package main

import (
	"log"
)
func test() {
	log.SetFlags(log.Ldate |log.Lmicroseconds | log.Lshortfile)
	log.Println("hello")
	log.SetPrefix("testtest")
	log.Println("world")
}

func main() {
	test()
}

输出:
2017/09/07 15:28:51.502985 test_log.go:8: hello
testtest2017/09/07 15:28:51.526986 test_log.go:10: world

 

转载于:https://my.oschina.net/u/3665115/blog/1531319

你可能感兴趣的:(log测试)