Commit fd7d6424 by usual2970

添加日志

parent 636919ef
......@@ -4,7 +4,6 @@ import (
"github.com/astaxie/beego"
"github.com/usual2970/util/tel"
"github.com/usual2970/util/service/models"
"log"
)
type TelController struct {
......@@ -31,8 +30,7 @@ func (c *TelController) Dial() {
resp,err:=telObj.Dial()
if err!=nil{
log.SetFlags(log.Lshortfile | log.LstdFlags)
log.Println( err)
log.Info(string(err))
rs.ErrNo="2"
rs.Msg="拨打失败"
break
......@@ -71,3 +69,9 @@ func (c *TelController) Cancel(){
c.Data["json"] = rs
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