本文整理匯總了Python中tools.log.Log.error方法的典型用法代碼示例。如果您正苦於以下問題:Python Log.error方法的具體用法?Python Log.error怎麽用?Python Log.error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tools.log.Log
的用法示例。
在下文中一共展示了Log.error方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _handle_request_exception
# 需要導入模塊: from tools.log import Log [as 別名]
# 或者: from tools.log.Log import error [as 別名]
def _handle_request_exception(self, e):
self.db.rollback()
if isinstance(e, JsonException):
Log.error(e.tojson)
self.finish_json(errcode=e.errcode, errmsg=e.errmsg)
else:
Log.error(traceback.format_exc())
super(BtwBaseHandler, self)._handle_request_exception(e)
示例2: add_hotels
# 需要導入模塊: from tools.log import Log [as 別名]
# 或者: from tools.log.Log import error [as 別名]
def add_hotels(self, hotels):
hotel_mappings = []
for hotel in hotels:
try:
hotel_mapping = self.add_hotel_mapping(hotel)
hotel_mappings.append(hotel_mapping)
except:
Log.info(">>> push ebooking hotel {} fail !!!".format(hotel))
Log.error(traceback.format_exc())
self.db.rollback()
return hotel_mappings
示例3: push_roomtype
# 需要導入模塊: from tools.log import Log [as 別名]
# 或者: from tools.log.Log import error [as 別名]
def push_roomtype(self, roomtype_id):
Log.info("<<POI push room mapping {}>> start".format(roomtype_id))
room = CooperateRoomTypeModel.get_by_id(self.db, roomtype_id)
if not room:
Log.error("<<POI push room mapping {}>> no roomtype".format(roomtype_id))
raise gen.Return(False)
room_data = self.generate_data(room)
r = yield self.post_room(room_data)
raise gen.Return(r)
示例4: add_roomtypes
# 需要導入模塊: from tools.log import Log [as 別名]
# 或者: from tools.log.Log import error [as 別名]
def add_roomtypes(self, roomtypes):
roomtype_mappings = []
for roomtype in roomtypes:
try:
roomtype_mapping = self.add_roomtype(roomtype)
roomtype_mappings.append(roomtype_mapping)
except:
Log.info(">>> push ebooking room {} fail !!!".format(roomtype))
Log.error(traceback.format_exc())
self.db.rollback()
return roomtype_mappings
示例5: push_roomtype
# 需要導入模塊: from tools.log import Log [as 別名]
# 或者: from tools.log.Log import error [as 別名]
def push_roomtype(self, roomtype_id):
Log.info("<<POI push room mapping {}>> start".format(roomtype_id))
if not IS_PUSH_TO_POI:
return
from models.cooperate_roomtype import CooperateRoomTypeModel
room = CooperateRoomTypeModel.get_by_id(self.session, roomtype_id)
if not room:
Log.error("no roomtype")
return
room_data = self.generate_data(room)
self.post_room(room_data)