Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[READY] Pass ycmd logging level to JediHTTP #513

Merged
merged 1 commit into from
Jun 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 accepts 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