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


Python LOGGER.info方法代码示例

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


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

示例1: _StartServer

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [as 别名]
  def _StartServer( self ):
    with self._tsserver_lock:
      if self._ServerIsRunning():
        return

      self._logfile = utils.CreateLogfile( LOGFILE_FORMAT )
      tsserver_log = '-file {path} -level {level}'.format( path = self._logfile,
                                                           level = _LogLevel() )
      # TSServer gets the configuration for the log file through the
      # environment variable 'TSS_LOG'. This seems to be undocumented but
      # looking at the source code it seems like this is the way:
      # https://github.com/Microsoft/TypeScript/blob/8a93b489454fdcbdf544edef05f73a913449be1d/src/server/server.ts#L136
      environ = os.environ.copy()
      utils.SetEnviron( environ, 'TSS_LOG', tsserver_log )

      LOGGER.info( 'TSServer log file: %s', self._logfile )

      # We need to redirect the error stream to the output one on Windows.
      self._tsserver_handle = utils.SafePopen( self._tsserver_executable,
                                               stdin = subprocess.PIPE,
                                               stdout = subprocess.PIPE,
                                               stderr = subprocess.STDOUT,
                                               env = environ )

      self._tsserver_is_running.set()

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

示例2: _CallGlobalExtraConfMethod

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [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

示例3: _ReaderLoop

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [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

示例4: GetReady

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [as 别名]
def GetReady():
  LOGGER.info( 'Received ready request' )
  if request.query.subserver:
    filetype = request.query.subserver
    completer = _server_state.GetFiletypeCompleter( [ filetype ] )
    return _JsonResponse( completer.ServerIsReady() )
  return _JsonResponse( True )
开发者ID:SolaWing,项目名称:ycmd,代码行数:9,代码来源:handlers.py

示例5: StartServer

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [as 别名]
  def StartServer( self, request_data ):
    with self._server_state_mutex:
      LOGGER.info( 'Starting %s: %s',
                   self.GetServerName(),
                   self.GetCommandLine() )

      self._stderr_file = utils.CreateLogfile( '{}_stderr'.format(
        utils.MakeSafeFileNameString( self.GetServerName() ) ) )

      with utils.OpenForStdHandle( self._stderr_file ) as stderr:
        self._server_handle = utils.SafePopen( self.GetCommandLine(),
                                               stdin = subprocess.PIPE,
                                               stdout = subprocess.PIPE,
                                               stderr = stderr )

      self._connection = (
        lsc.StandardIOLanguageServerConnection(
          self._server_handle.stdin,
          self._server_handle.stdout,
          self.GetDefaultNotificationHandler() )
      )

      self._connection.Start()

      try:
        self._connection.AwaitServerConnection()
      except lsc.LanguageServerConnectionTimeout:
        LOGGER.error( '%s failed to start, or did not connect successfully',
                      self.GetServerName() )
        self.Shutdown()
        return False

    LOGGER.info( '%s started', self.GetServerName() )

    return True
开发者ID:SolaWing,项目名称:ycmd,代码行数:37,代码来源:simple_language_server_completer.py

示例6: GetClangdExecutableAndResourceDir

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [as 别名]
def GetClangdExecutableAndResourceDir( user_options ):
  """Return the Clangd binary from the path specified in the
  'clangd_binary_path' option. Let the binary find its resource directory in
  that case. If no binary is found or if it's out-of-date, return nothing. If
  'clangd_binary_path' is empty, return the third-party Clangd and its resource
  directory if the user downloaded it and if it's up to date. Otherwise, return
  nothing."""
  clangd = user_options[ 'clangd_binary_path' ]
  resource_dir = None

  if clangd:
    clangd = FindExecutable( ExpandVariablesInPath( clangd ) )

    if not clangd:
      LOGGER.error( 'No Clangd executable found at %s',
                    user_options[ 'clangd_binary_path' ] )
      return None, None

    if not CheckClangdVersion( clangd ):
      LOGGER.error( 'Clangd at %s is out-of-date', clangd )
      return None, None

  # Try looking for the pre-built binary.
  else:
    third_party_clangd = GetThirdPartyClangd()
    if not third_party_clangd:
      return None, None
    clangd = third_party_clangd
    resource_dir = CLANG_RESOURCE_DIR

  LOGGER.info( 'Using Clangd from %s', clangd )
  return clangd, resource_dir
开发者ID:SolaWing,项目名称:ycmd,代码行数:34,代码来源:clangd_completer.py

示例7: PollModule

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [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

示例8: _ChooseOmnisharpPort

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [as 别名]
 def _ChooseOmnisharpPort( self ):
   if not self._omnisharp_port:
     if self._desired_omnisharp_port:
       self._omnisharp_port = int( self._desired_omnisharp_port )
     else:
       self._omnisharp_port = utils.GetUnusedLocalhostPort()
   LOGGER.info( 'using port %s', self._omnisharp_port )
开发者ID:SolaWing,项目名称:ycmd,代码行数:9,代码来源:cs_completer.py

示例9: ShouldEnableTypeScriptCompleter

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [as 别名]
def ShouldEnableTypeScriptCompleter():
  tsserver = FindTSServer()
  if not tsserver:
    LOGGER.error( 'Not using TypeScript completer: TSServer not installed '
                  'in %s', TSSERVER_DIR )
    return False
  LOGGER.info( 'Using TypeScript completer with %s', tsserver )
  return True
开发者ID:christophermca,项目名称:dotfiles,代码行数:10,代码来源:typescript_completer.py

示例10: RunCompleterCommand

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [as 别名]
def RunCompleterCommand():
  LOGGER.info( 'Received command request' )
  request_data = RequestWrap( request.json )
  completer = _GetCompleterForRequestData( request_data )

  return _JsonResponse( completer.OnUserCommand(
      request_data[ 'command_arguments' ],
      request_data ) )
开发者ID:SolaWing,项目名称:ycmd,代码行数:10,代码来源:handlers.py

示例11: StartServer

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [as 别名]
  def StartServer( self, request_data, project_directory = None ):
    with self._server_state_mutex:
      LOGGER.info( 'Starting jdt.ls Language Server...' )

      if project_directory:
        self._java_project_dir = project_directory
      else:
        self._java_project_dir = _FindProjectDir(
          os.path.dirname( request_data[ 'filepath' ] ) )

      self._workspace_path = _WorkspaceDirForProject(
        self._java_project_dir,
        self._use_clean_workspace )

      command = [
        PATH_TO_JAVA,
        '-Dfile.encoding=UTF-8',
        '-Declipse.application=org.eclipse.jdt.ls.core.id1',
        '-Dosgi.bundles.defaultStartLevel=4',
        '-Declipse.product=org.eclipse.jdt.ls.core.product',
        '-Dlog.level=ALL',
        '-jar', self._launcher_path,
        '-configuration', self._launcher_config,
        '-data', self._workspace_path,
      ]

      LOGGER.debug( 'Starting java-server with the following command: %s',
                    command )

      self._server_stderr = utils.CreateLogfile( 'jdt.ls_stderr_' )
      with utils.OpenForStdHandle( self._server_stderr ) as stderr:
        self._server_handle = utils.SafePopen( command,
                                               stdin = PIPE,
                                               stdout = PIPE,
                                               stderr = stderr )

      self._connection = (
        language_server_completer.StandardIOLanguageServerConnection(
          self._server_handle.stdin,
          self._server_handle.stdout,
          self.GetDefaultNotificationHandler() )
      )

      self._connection.Start()

      try:
        self._connection.AwaitServerConnection()
      except language_server_completer.LanguageServerConnectionTimeout:
        LOGGER.error( 'jdt.ls failed to start, or did not connect '
                      'successfully' )
        self.Shutdown()
        return False

    LOGGER.info( 'jdt.ls Language Server started' )

    return True
开发者ID:SolaWing,项目名称:ycmd,代码行数:58,代码来源:java_completer.py

示例12: GetThirdPartyClangd

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [as 别名]
def GetThirdPartyClangd():
  pre_built_clangd = GetExecutable( PRE_BUILT_CLANDG_PATH )
  if not pre_built_clangd:
    LOGGER.info( 'No Clangd executable found in %s', PRE_BUILT_CLANGD_DIR )
    return None
  if not CheckClangdVersion( pre_built_clangd ):
    LOGGER.error( 'Clangd executable at %s is out-of-date', pre_built_clangd )
    return None
  LOGGER.info( 'Clangd executable found at %s and up to date',
               PRE_BUILT_CLANGD_DIR )
  return pre_built_clangd
开发者ID:SolaWing,项目名称:ycmd,代码行数:13,代码来源:clangd_completer.py

示例13: FilterAndSortCandidates

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [as 别名]
def FilterAndSortCandidates():
  LOGGER.info( 'Received filter & sort request' )
  # Not using RequestWrap because no need and the requests coming in aren't like
  # the usual requests we handle.
  request_data = request.json

  return _JsonResponse( FilterAndSortCandidatesWrap(
    request_data[ 'candidates' ],
    request_data[ 'sort_property' ],
    request_data[ 'query' ],
    _server_state.user_options[ 'max_num_candidates' ] ) )
开发者ID:SolaWing,项目名称:ycmd,代码行数:13,代码来源:handlers.py

示例14: HandleNotificationInPollThread

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [as 别名]
  def HandleNotificationInPollThread( self, notification ):
    if notification[ 'method' ] == 'language/status':
      message_type = notification[ 'params' ][ 'type' ]

      if message_type == 'Started':
        LOGGER.info( 'jdt.ls initialized successfully' )
        self._server_init_status = notification[ 'params' ][ 'message' ]
        self._received_ready_message.set()
      elif not self._received_ready_message.is_set():
        self._server_init_status = notification[ 'params' ][ 'message' ]

    super( JavaCompleter, self ).HandleNotificationInPollThread( notification )
开发者ID:christophermca,项目名称:dotfiles,代码行数:14,代码来源:java_completer.py

示例15: _StopServer

# 需要导入模块: from ycmd.utils import LOGGER [as 别名]
# 或者: from ycmd.utils.LOGGER import info [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


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