- log msg refactor, add orderID to all logs.
This commit is contained in:
@@ -35,7 +35,7 @@ func addOrderOrWaybillStatus(status *model.OrderStatus, db orm.Ormer) (isDuplica
|
||||
created, _, err := db.ReadOrCreate(status, "VendorOrderID", "VendorID", "OrderType", "VendorStatus", "StatusTime")
|
||||
if err == nil {
|
||||
if !created {
|
||||
globals.SugarLogger.Infof("duplicated event:%v", status)
|
||||
globals.SugarLogger.Debugf("duplicated event:%v", status)
|
||||
isDuplicated = true
|
||||
status.DuplicatedCount++
|
||||
utils.CallFuncLogError(func() error {
|
||||
@@ -46,7 +46,7 @@ func addOrderOrWaybillStatus(status *model.OrderStatus, db orm.Ormer) (isDuplica
|
||||
}
|
||||
if err != nil {
|
||||
// todo 这里居然会有主键重复错误,逻辑上是不应该的
|
||||
globals.SugarLogger.Warnf("access db error:%v", err)
|
||||
globals.SugarLogger.Warnf("addOrderOrWaybillStatus status:%v, access db error:%v", status, err)
|
||||
}
|
||||
return isDuplicated, err
|
||||
}
|
||||
@@ -85,7 +85,7 @@ func GetDataCityCodeFromOrder(order *model.GoodsOrder) (retVal string, err error
|
||||
if err != nil && num == 1 {
|
||||
retVal = lists[0][0].(string)
|
||||
} else {
|
||||
globals.SugarLogger.Errorf("can not find store info for vendorID:%d, store:%s", order.VendorID, order.VendorStoreID)
|
||||
globals.SugarLogger.Errorf("GetDataCityCodeFromOrder can not find store info for vendorID:%d, store:%s", order.VendorID, order.VendorStoreID)
|
||||
}
|
||||
return retVal, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user