本文整理汇总了Python中heron.common.src.python.color.Log.exception方法的典型用法代码示例。如果您正苦于以下问题:Python Log.exception方法的具体用法?Python Log.exception怎么用?Python Log.exception使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类heron.common.src.python.color.Log
的用法示例。
在下文中一共展示了Log.exception方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: launch_topologies
# 需要导入模块: from heron.common.src.python.color import Log [as 别名]
# 或者: from heron.common.src.python.color.Log import exception [as 别名]
def launch_topologies(cl_args, topology_file, tmp_dir):
'''
Launch topologies
:param cl_args:
:param topology_file:
:param tmp_dir:
:return:
'''
# the submitter would have written the .defn file to the tmp_dir
defn_files = glob.glob(tmp_dir + '/*.defn')
if len(defn_files) == 0:
raise Exception("No topologies found")
try:
for defn_file in defn_files:
# load the topology definition from the file
topology_defn = topology_pb2.Topology()
try:
handle = open(defn_file, "rb")
topology_defn.ParseFromString(handle.read())
handle.close()
except:
raise Exception("Could not open and parse topology defn file %s" % defn_file)
# launch the topology
try:
Log.info("Launching topology \'%s\'" % topology_defn.name)
launch_a_topology(cl_args, tmp_dir, topology_file, defn_file)
Log.info("Topology \'%s\' launched successfully" % topology_defn.name)
except Exception as ex:
Log.exception('Failed to launch topology \'%s\' because %s' % (topology_defn.name, str(ex)))
raise
except:
raise