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


Python LOGGER.exception方法代码示例

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


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

示例1: FiletypeCompletionAvailable

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
 def FiletypeCompletionAvailable( self, filetypes ):
   try:
     self.GetFiletypeCompleter( filetypes )
     return True
   except Exception:
     LOGGER.exception( 'Semantic completion not available for %s', filetypes )
     return False
开发者ID:SolaWing,项目名称:ycmd,代码行数:9,代码来源:server_state.py

示例2: PollModule

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
def PollModule( module, filepath ):
  """ Try to use passed module in the selection process by calling
  CSharpSolutionFile on it """
  path_to_solutionfile = None
  module_hint = None
  if module:
    try:
      module_hint = module.CSharpSolutionFile( filepath )
      LOGGER.info( 'extra_conf_store suggests %s as solution file',
                   module_hint )
      if module_hint:
        # received a full path or one relative to the config's location?
        candidates = [ module_hint,
          os.path.join( os.path.dirname( getfile( module ) ),
                        module_hint ) ]
        # try the assumptions
        for path in candidates:
          if os.path.isfile( path ):
            # path seems to point to a solution
            path_to_solutionfile = path
            LOGGER.info( 'Using solution file %s selected by extra_conf_store',
                         path_to_solutionfile )
            break
    except AttributeError:
      # the config script might not provide solution file locations
      LOGGER.exception( 'Could not retrieve solution for %s'
                        'from extra_conf_store', filepath )
  return path_to_solutionfile
开发者ID:SolaWing,项目名称:ycmd,代码行数:30,代码来源:solutiondetection.py

示例3: _CleanUp

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
  def _CleanUp( self ):
    if not self._server_keep_logfiles:
      if self._server_stderr:
        utils.RemoveIfExists( self._server_stderr )
        self._server_stderr = None

    if self._workspace_path and self._use_clean_workspace:
      try:
        shutil.rmtree( self._workspace_path )
      except OSError:
        LOGGER.exception( 'Failed to clean up workspace dir %s',
                          self._workspace_path )

    self._launcher_path = _PathToLauncherJar()
    self._launcher_config = _LauncherConfiguration()
    self._workspace_path = None
    self._java_project_dir = None
    self._received_ready_message = threading.Event()
    self._server_init_status = 'Not started'
    self._server_started = False

    self._server_handle = None
    self._connection = None
    self._started_message_sent = False

    self.ServerReset()
开发者ID:christophermca,项目名称:dotfiles,代码行数:28,代码来源:java_completer.py

示例4: _ReaderLoop

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
  def _ReaderLoop( self ):
    """
    Read responses from TSServer and use them to resolve
    the DeferredResponse instances.
    """

    while True:
      self._tsserver_is_running.wait()

      try:
        message = self._ReadMessage()
      except ( RuntimeError, ValueError ):
        LOGGER.exception( 'Error while reading message from server' )
        if not self._ServerIsRunning():
          self._tsserver_is_running.clear()
        continue

      # We ignore events for now since we don't have a use for them.
      msgtype = message[ 'type' ]
      if msgtype == 'event':
        eventname = message[ 'event' ]
        LOGGER.info( 'Received %s event from TSServer',  eventname )
        continue
      if msgtype != 'response':
        LOGGER.error( 'Unsupported message type', msgtype )
        continue

      seq = message[ 'request_seq' ]
      with self._pending_lock:
        if seq in self._pending:
          self._pending[ seq ].resolve( message )
          del self._pending[ seq ]
开发者ID:christophermca,项目名称:dotfiles,代码行数:34,代码来源:typescript_completer.py

示例5: _CallGlobalExtraConfMethod

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
def _CallGlobalExtraConfMethod( function_name ):
  global_ycm_extra_conf = _GlobalYcmExtraConfFileLocation()
  if not ( global_ycm_extra_conf and
           os.path.exists( global_ycm_extra_conf ) ):
    LOGGER.debug( 'No global extra conf, not calling method %s', function_name )
    return

  try:
    module = Load( global_ycm_extra_conf, force = True )
  except Exception:
    LOGGER.exception( 'Error occurred while loading global extra conf %s',
                      global_ycm_extra_conf )
    return

  if not module or not hasattr( module, function_name ):
    LOGGER.debug( 'Global extra conf not loaded or no function %s',
                  function_name )
    return

  try:
    LOGGER.info( 'Calling global extra conf method %s on conf file %s',
                 function_name,
                 global_ycm_extra_conf )
    getattr( module, function_name )()
  except Exception:
    LOGGER.exception(
      'Error occurred while calling global extra conf method %s '
      'on conf file %s', function_name, global_ycm_extra_conf )
开发者ID:SolaWing,项目名称:ycmd,代码行数:30,代码来源:extra_conf_store.py

示例6: _CurrentLine

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
 def _CurrentLine( self ):
   try:
     return self[ 'lines' ][ self[ 'line_num' ] - 1 ]
   except IndexError:
     LOGGER.exception( 'Client returned invalid line number %s '
                       'for file %s. Assuming empty',
                       self[ 'line_num' ],
                       self[ 'filepath' ] )
     return ''
开发者ID:SolaWing,项目名称:ycmd,代码行数:11,代码来源:request_wrap.py

示例7: _GetDoc

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
  def _GetDoc( self, request_data ):
    try:
      definition = self._GetResponse( '/find_definition',
                                      request_data )

      docs = [ definition[ 'context' ], definition[ 'docs' ] ]
      return responses.BuildDetailedInfoResponse( '\n---\n'.join( docs ) )
    except Exception:
      LOGGER.exception( 'Failed to find definition' )
      raise RuntimeError( 'Can\'t lookup docs.' )
开发者ID:Valloric,项目名称:ycmd,代码行数:12,代码来源:rust_completer.py

示例8: _GoToDefinition

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
 def _GoToDefinition( self, request_data ):
   try:
     definition = self._GetResponse( '/find_definition',
                                     request_data )
     return responses.BuildGoToResponse( definition[ 'file_path' ],
                                         definition[ 'line' ],
                                         definition[ 'column' ] + 1 )
   except Exception:
     LOGGER.exception( 'Failed to find definition' )
     raise RuntimeError( 'Can\'t jump to definition.' )
开发者ID:Valloric,项目名称:ycmd,代码行数:12,代码来源:rust_completer.py

示例9: _GoTo

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
  def _GoTo( self, request_data ):
    try:
      return self._GoToDefinition( request_data )
    except Exception:
      LOGGER.exception( 'Failed to jump to definition' )

    try:
      return self._GoToDeclaration( request_data )
    except Exception:
      LOGGER.exception( 'Failed to jump to declaration' )
      raise RuntimeError( 'Can\'t jump to definition or declaration.' )
开发者ID:SolaWing,项目名称:ycmd,代码行数:13,代码来源:python_completer.py

示例10: _WriteRequest

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
  def _WriteRequest( self, request ):
    """Write a request to TSServer stdin."""

    serialized_request = utils.ToBytes( json.dumps( request ) + '\n' )
    with self._write_lock:
      try:
        self._tsserver_handle.stdin.write( serialized_request )
        self._tsserver_handle.stdin.flush()
      # IOError is an alias of OSError in Python 3.
      except ( AttributeError, IOError ):
        LOGGER.exception( SERVER_NOT_RUNNING_MESSAGE )
        raise RuntimeError( SERVER_NOT_RUNNING_MESSAGE )
开发者ID:christophermca,项目名称:dotfiles,代码行数:14,代码来源:typescript_completer.py

示例11: _StopServer

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
  def _StopServer( self ):
    with self._server_state_lock:
      if self._racerd_phandle:
        LOGGER.info( 'Stopping Racerd with PID %s', self._racerd_phandle.pid )
        self._racerd_phandle.terminate()
        try:
          utils.WaitUntilProcessIsTerminated( self._racerd_phandle,
                                              timeout = 5 )
          LOGGER.info( 'Racerd stopped' )
        except RuntimeError:
          LOGGER.exception( 'Error while stopping Racerd' )

      self._CleanUp()
开发者ID:Valloric,项目名称:ycmd,代码行数:15,代码来源:rust_completer.py

示例12: _StopServer

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
  def _StopServer( self ):
    with self._tsserver_lock:
      if self._ServerIsRunning():
        LOGGER.info( 'Stopping TSServer with PID %s',
                     self._tsserver_handle.pid )
        try:
          self._SendCommand( 'exit' )
          utils.WaitUntilProcessIsTerminated( self._tsserver_handle,
                                              timeout = 5 )
          LOGGER.info( 'TSServer stopped' )
        except Exception:
          LOGGER.exception( 'Error while stopping TSServer' )

      self._CleanUp()
开发者ID:christophermca,项目名称:dotfiles,代码行数:16,代码来源:typescript_completer.py

示例13: _StopServer

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
  def _StopServer( self ):
    with self._server_state_mutex:
      if self._ServerIsRunning():
        LOGGER.info( 'Stopping Tern server with PID %s',
                     self._server_handle.pid )
        self._server_handle.terminate()
        try:
          utils.WaitUntilProcessIsTerminated( self._server_handle,
                                              timeout = 5 )
          LOGGER.info( 'Tern server stopped' )
        except RuntimeError:
          LOGGER.exception( 'Error while stopping Tern server' )

      self._CleanUp()
开发者ID:SolaWing,项目名称:ycmd,代码行数:16,代码来源:tern_completer.py

示例14: _StopServer

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
  def _StopServer( self ):
    """ Stop the OmniSharp server using a lock. """
    with self._server_state_lock:
      if self._ServerIsRunning():
        LOGGER.info( 'Stopping OmniSharp server with PID %s',
                     self._omnisharp_phandle.pid )
        try:
          self._GetResponse( '/stopserver' )
          utils.WaitUntilProcessIsTerminated( self._omnisharp_phandle,
                                              timeout = 5 )
          LOGGER.info( 'OmniSharp server stopped' )
        except Exception:
          LOGGER.exception( 'Error while stopping OmniSharp server' )

      self._CleanUp()
开发者ID:SolaWing,项目名称:ycmd,代码行数:17,代码来源:cs_completer.py

示例15: GetFileContents

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import exception [as 别名]
def GetFileContents( request_data, filename ):
  """Returns the contents of the absolute path |filename| as a unicode
  string. If the file contents exist in |request_data| (i.e. it is open and
  potentially modified/dirty in the user's editor), then it is returned,
  otherwise the file is read from disk (assuming a UTF-8 encoding) and its
  contents returned."""
  file_data = request_data[ 'file_data' ]
  if filename in file_data:
    return ToUnicode( file_data[ filename ][ 'contents' ] )

  try:
    return ToUnicode( ReadFile( filename ) )
  except IOError:
    LOGGER.exception( 'Error reading file %s', filename )
    return ''
开发者ID:SolaWing,项目名称:ycmd,代码行数:17,代码来源:completer_utils.py


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