Improved log messages if version of Ultimate cannot be detected
@@ -134,34 +134,33 @@ class UltimateTool(benchexec.tools.template.BaseTool):
(stdout, stderr) = process.communicate()
except OSError as e:
logging.warning(
- "Cannot run Java to determine Ultimate version (API {0}): {1}".format(
- api, e.strerror
- )
- )
- return ""
- if stderr:
- logging.warning(
- "Cannot determine Ultimate version (API {0}). Error output: {1}".format(
- api, util.decode_to_string(stderr)
- )
+ "Cannot run Java to determine Ultimate version (API %s): %s",
+ api,
+ e.strerror,
)
return ""
- if process.returncode:
+ stdout = util.decode_to_string(stdout).strip()
+ if stderr or process.returncode:
logging.warning(
- "Cannot determine Ultimate version (API {0}). Exit code : {1}\nCommand was {2}".format(
- api, process.returncode, " ".join(cmd)
- )
+ "Cannot determine Ultimate version (API %s).\n"
+ "Command was: %s\n"
+ "Exit code: %s\n"
+ "Error output: %s\n"
+ "Standard output: %s",
+ api,
+ " ".join(map(util.escape_string_shell, cmd)),
+ process.returncode,
+ util.decode_to_string(stderr),
+ stdout,
)
return ""
- version_ultimate_match = _ULTIMATE_VERSION_REGEX.search(
- util.decode_to_string(stdout)
- )
+ version_ultimate_match = _ULTIMATE_VERSION_REGEX.search(stdout)
if not version_ultimate_match:
logging.warning(
- "Cannot determine Ultimate version, output (API {0}): {1}".format(
- api, util.decode_to_string(stdout)
- )
+ "Cannot determine Ultimate version (API %s), output was: %s",
+ api,
+ stdout,
)
return ""
return version_ultimate_match.group(1)
