`log.Println("blablabla")` will format all the message output to console,
but I want to show log information just in debug mode ;(
As far, I can do this to finish my job:
package main
import "log"
type mylog struct {}
func (m mylog) Write(p []byte) (n int, err error){return 0, nil}
func main(){
m := new(mylog)
log.SetOutput(m)
log.Println("this")
}
But it seems urgly.
Is there any good idea to output the log by the setting levels, just like
python:
logger.set_level(debug|warning|info|...) ?
--