[REV] add log

This commit is contained in:
bay1ts 2017-11-16 17:56:32 +08:00
parent 641f395a31
commit 746abc5dcc
2 changed files with 6 additions and 9 deletions

View File

@ -25,6 +25,8 @@ import (
"github.com/jinzhu/gorm"
"fmt"
"time"
"github.com/Sirupsen/logrus"
"encoding/json"
)
@ -51,6 +53,8 @@ func (c *EventDaoImpl) UpdateModel(mo model.Interface) error {
var oldResult model.ServiceEvent
if ok := c.DB.Where("event_id=?", result.EventID).Find(&oldResult).RecordNotFound(); !ok {
finalUpdateEvent(result,&oldResult)
b,_:=json.Marshal(oldResult)
logrus.Infof("saving to even %s",string(b))
if err := c.DB.Save(oldResult).Error; err != nil {
return err
}

View File

@ -291,20 +291,13 @@ func (h *handleMessageStore) handleBarrelEvent() {
webhook.GetManager().RunWebhookWithParameter(webhook.UpDateEventStatus, nil,
map[string]interface{}{"event_id": eventID, "status": status, "message": message})
//todo update db
for k:=0;k<100;k++{
logrus.Infof("-------------------callbacking")
logrus.Infof("-------------------callbacking")
logrus.Infof("-------------------callbacking")
logrus.Infof("-------------------callbacking")
logrus.Infof("-------------------callbacking")
logrus.Infof("-------------------callbacking")
logrus.Infof("-------------------callbacking")
}
event:=model.ServiceEvent{}
event.EventID=eventID
event.Status=status
event.Message=message
logrus.Infof("-----------%s",status)
cdb.GetManager().EventLogDao().UpdateModel(&event)
}