From daa0d506556b5063b4cf2e63bffa2d0c8cdb4082 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Tue, 8 Oct 2013 20:20:15 -0700 Subject: [PATCH] Removed the logging code from Clang completer The exceptions are already logged by Bottle so what's the point. Also removed an outdated TODO. --- python/ycm/completers/cpp/clang_completer.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/python/ycm/completers/cpp/clang_completer.py b/python/ycm/completers/cpp/clang_completer.py index 154452fa..f892b304 100644 --- a/python/ycm/completers/cpp/clang_completer.py +++ b/python/ycm/completers/cpp/clang_completer.py @@ -19,7 +19,6 @@ from collections import defaultdict import ycm_core -import logging from ycm.server import responses from ycm import extra_conf_store from ycm.utils import ToUtf8IfNeeded @@ -46,7 +45,6 @@ class ClangCompleter( Completer ): self._completer = ycm_core.ClangCompleter() self._flags = Flags() self._diagnostic_store = None - self._logger = logging.getLogger( __name__ ) def SupportedFiletypes( self ): @@ -78,15 +76,10 @@ class ClangCompleter( Completer ): return if self._completer.UpdatingTranslationUnit( ToUtf8IfNeeded( filename ) ): - self._logger.info( PARSING_FILE_MESSAGE ) - # TODO: For this exception and the NO_COMPILE_FLAGS one, use a special - # exception class so that the client can be more silent about these - # messages. raise RuntimeError( PARSING_FILE_MESSAGE ) flags = self._FlagsForRequest( request_data ) if not flags: - self._logger.info( NO_COMPILE_FLAGS_MESSAGE ) raise RuntimeError( NO_COMPILE_FLAGS_MESSAGE ) files = self.GetUnsavedFilesVector( request_data ) @@ -100,7 +93,6 @@ class ClangCompleter( Completer ): flags ) if not results: - self._logger.warning( NO_COMPLETIONS_MESSAGE ) raise RuntimeError( NO_COMPLETIONS_MESSAGE ) return [ ConvertCompletionData( x ) for x in results ] @@ -132,12 +124,10 @@ class ClangCompleter( Completer ): def _LocationForGoTo( self, goto_function, request_data ): filename = request_data[ 'filepath' ] if not filename: - self._logger.warning( INVALID_FILE_MESSAGE ) raise ValueError( INVALID_FILE_MESSAGE ) flags = self._FlagsForRequest( request_data ) if not flags: - self._logger.info( NO_COMPILE_FLAGS_MESSAGE ) raise ValueError( NO_COMPILE_FLAGS_MESSAGE ) files = self.GetUnsavedFilesVector( request_data ) @@ -192,16 +182,13 @@ class ClangCompleter( Completer ): filename = request_data[ 'filepath' ] contents = request_data[ 'file_data' ][ filename ][ 'contents' ] if contents.count( '\n' ) < MIN_LINES_IN_FILE_TO_PARSE: - self._logger.warning( FILE_TOO_SHORT_MESSAGE ) raise ValueError( FILE_TOO_SHORT_MESSAGE ) if not filename: - self._logger.warning( INVALID_FILE_MESSAGE ) raise ValueError( INVALID_FILE_MESSAGE ) flags = self._FlagsForRequest( request_data ) if not flags: - self._logger.info( NO_COMPILE_FLAGS_MESSAGE ) raise ValueError( NO_COMPILE_FLAGS_MESSAGE ) diagnostics = self._completer.UpdateTranslationUnit(