package logs import ( "fmt" "github.com/astaxie/beego/logs" "runtime" ) var Test = true var logx *logs.BeeLogger var logxE *logs.BeeLogger func init() { if runtime.GOOS == "windows" { Test = true } else { Test = false } logx = logs.NewLogger() logx.SetLogger(logs.AdapterFile, `{"filename":"logs/logx/logx.log"}`) logxE = logs.NewLogger() logxE.SetLogger(logs.AdapterFile, `{"filename":"logs/logxE/logx.log"}`) } func Println(format string, v ...interface{}) { if Test{fmt.Println(format, v)} logx.Info(format, v) } func PrintlnError(format string, v ...interface{}) { if Test{fmt.Println(format, v)} logxE.Error(format, v) logx.Info(format, v) }