Commit fd7d6424 by usual2970

添加日志

parent 636919ef
...@@ -4,7 +4,6 @@ import ( ...@@ -4,7 +4,6 @@ import (
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/usual2970/util/tel" "github.com/usual2970/util/tel"
"github.com/usual2970/util/service/models" "github.com/usual2970/util/service/models"
"log"
) )
type TelController struct { type TelController struct {
...@@ -31,8 +30,7 @@ func (c *TelController) Dial() { ...@@ -31,8 +30,7 @@ func (c *TelController) Dial() {
resp,err:=telObj.Dial() resp,err:=telObj.Dial()
if err!=nil{ if err!=nil{
log.SetFlags(log.Lshortfile | log.LstdFlags) log.Info(string(err))
log.Println( err)
rs.ErrNo="2" rs.ErrNo="2"
rs.Msg="拨打失败" rs.Msg="拨打失败"
break break
...@@ -71,3 +69,9 @@ func (c *TelController) Cancel(){ ...@@ -71,3 +69,9 @@ func (c *TelController) Cancel(){
c.Data["json"] = rs c.Data["json"] = rs
c.ServeJSON() c.ServeJSON()
} }
func init(){
log=logs.NewLogger(64)
log.SetLogger("file",`{"filename":"/var/log/goyidianling.log"}`)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment