log.go: simple wrapper for the log pkg.

To get something like log level.
This commit is contained in:
Chen Yufei
2012-08-24 00:00:47 +08:00
parent 1337169580
commit d4d40bf546

20
log.go Normal file
View File

@@ -0,0 +1,20 @@
package main
import "log"
type loglevel bool
const debug loglevel = true
const info loglevel = true
func (d loglevel) Printf(format string, args ...interface{}) {
if d {
log.Printf(format, args...)
}
}
func (d loglevel) Println(args ...interface{}) {
if d {
log.Println(args...)
}
}