mirror of
https://github.com/zhigang1992/cow.git
synced 2026-01-12 22:46:29 +08:00
log.go: simple wrapper for the log pkg.
To get something like log level.
This commit is contained in:
20
log.go
Normal file
20
log.go
Normal 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...)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user