当前位置: 首页>>代码示例>>Python>>正文


Python Log.error方法代码示例

本文整理汇总了Python中heron.statemgrs.src.python.log.Log.error方法的典型用法代码示例。如果您正苦于以下问题:Python Log.error方法的具体用法?Python Log.error怎么用?Python Log.error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在heron.statemgrs.src.python.log.Log的用法示例。


在下文中一共展示了Log.error方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_all_zk_state_managers

# 需要导入模块: from heron.statemgrs.src.python.log import Log [as 别名]
# 或者: from heron.statemgrs.src.python.log.Log import error [as 别名]
def get_all_zk_state_managers(conf):
  """
  Connects to all the zookeeper state_managers and returns
  the connected state_managers instances.
  """
  state_managers = []
  state_locations = conf.get_state_locations_of_type("zookeeper")
  for location in state_locations:
    name = location['name']
    hostport = location['hostport']
    host = None
    port = None
    if ':' in hostport:
      hostportlist = hostport.split(':')
      if len(hostportlist) == 2:
        host = hostportlist[0]
        port = int(hostportlist[1])
    if not host or not port:
      raise Exception("Hostport for %s must be of the format 'host:port'." % (name))
    tunnelhost = location['tunnelhost']
    rootpath = location['rootpath']
    LOG.info("Connecting to zk hostport: " + host + ":" + str(port) + " rootpath: " + rootpath)
    state_manager = ZkStateManager(name, host, port, rootpath, tunnelhost)
    try:
      state_manager.start()
    except Exception as e:
      LOG.error("Exception while connecting to state_manager.")
      traceback.print_exc()
    state_managers.append(state_manager)

  return state_managers
开发者ID:10fish,项目名称:heron,代码行数:33,代码来源:statemanagerfactory.py

示例2: get_all_state_managers

# 需要导入模块: from heron.statemgrs.src.python.log import Log [as 别名]
# 或者: from heron.statemgrs.src.python.log.Log import error [as 别名]
def get_all_state_managers(conf):
  """
  @param conf - An instance of Config class
  Reads the config for requested state managers.
  Instantiates them, start and then return them.
  """
  state_managers = []
  try:
    state_managers.extend(get_all_zk_state_managers(conf))
    state_managers.extend(get_all_file_state_managers(conf))
    return state_managers
  except Exception as ex:
    LOG.error("Exception while getting state_managers.")
    raise ex
开发者ID:lucperkins,项目名称:heron,代码行数:16,代码来源:statemanagerfactory.py

示例3: get_all_file_state_managers

# 需要导入模块: from heron.statemgrs.src.python.log import Log [as 别名]
# 或者: from heron.statemgrs.src.python.log.Log import error [as 别名]
def get_all_file_state_managers(conf):
  """
  Returns all the file state_managers.
  """
  state_managers = []
  state_locations = conf.get_state_locations_of_type("file")
  for location in state_locations:
    name = location['name']
    rootpath = os.path.expanduser(location['rootpath'])
    LOG.info("Connecting to file state with rootpath: " + rootpath)
    state_manager = FileStateManager(name, rootpath)
    try:
      state_manager.start()
    except Exception as e:
      LOG.error("Exception while connecting to state_manager.")
      traceback.print_exc()
    state_managers.append(state_manager)

  return state_managers
开发者ID:digitalis-io,项目名称:heron-elodina,代码行数:21,代码来源:statemanagerfactory.py

示例4: get_all_zk_state_managers

# 需要导入模块: from heron.statemgrs.src.python.log import Log [as 别名]
# 或者: from heron.statemgrs.src.python.log.Log import error [as 别名]
def get_all_zk_state_managers(conf):
  """
  Connects to all the zookeeper state_managers and returns
  the connected state_managers instances.
  """
  state_managers = []
  state_locations = conf.get_state_locations_of_type("zookeeper")
  for location in state_locations:
    name = location['name']
    host = location['host']
    port = location['port']
    tunnelhost = location['tunnelhost']
    rootpath = location['rootpath']
    LOG.info("Connecting to zk hostport: " + host + ":" + str(port) + " rootpath: " + rootpath)
    state_manager = ZkStateManager(name, host, port, rootpath, tunnelhost)
    try:
      state_manager.start()
    except Exception as e:
      LOG.error("Exception while connecting to state_manager.")
      traceback.print_exc()
    state_managers.append(state_manager)

  return state_managers
开发者ID:digitalis-io,项目名称:heron-elodina,代码行数:25,代码来源:statemanagerfactory.py


注:本文中的heron.statemgrs.src.python.log.Log.error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。