Skip to content

Commit

Permalink
Pass ycmd logging level to JediHTTP
Browse files Browse the repository at this point in the history
  • Loading branch information
micbou committed Jun 2, 2016
1 parent 65f1987 commit fb43ead
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion third_party/JediHTTP
8 changes: 8 additions & 0 deletions ycmd/completers/python/jedi_completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def _StartServer( self ):
command = [ self._python_binary_path,
PATH_TO_JEDIHTTP,
'--port', str( self._jedihttp_port ),
'--log', self._GetLoggingLevel(),
'--hmac-file-secret', hmac_file.name ]

self._logfile_stdout = LOG_FILENAME_FORMAT.format(
Expand All @@ -180,6 +181,13 @@ def _GenerateHmacSecret( self ):
return os.urandom( HMAC_SECRET_LENGTH )


def _GetLoggingLevel( self ):
# Tests are run with the NOTSET logging level but JediHTTP only accept
# the predefined levels above (DEBUG, INFO, WARNING, etc.).
log_level = max( self._logger.getEffectiveLevel(), logging.DEBUG )
return logging.getLevelName( log_level ).lower()


def _GetResponse( self, handler, request_data = {} ):
"""POST JSON data to JediHTTP server and return JSON response."""
handler = ToBytes( handler )
Expand Down

0 comments on commit fb43ead

Please sign in to comment.