Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekel Reches committed Sep 23, 2024
1 parent 3ae25d7 commit c092236
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions granulate_utils/gprofiler/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def get_java_version_logged(
logger: Union[logging.LoggerAdapter, logging.Logger],
) -> Optional[str]:
java_version = get_java_version(process, stop_event, logger)
logger.debug("java -version output", java_version_output=java_version, pid=process.pid)
logger.debug("java -version output", extra={"java_version_output": java_version, "pid": process.pid})
return java_version


Expand Down Expand Up @@ -678,7 +678,7 @@ def _run_async_profiler(self, cmd: List[str]) -> str:
else:
ap_log = self._read_ap_log()
ap_log_stripped = MEM_INFO_LOG_RE.sub("", ap_log) # strip out mem info log only when for gProfiler log
self.logger.debug("async-profiler log", jattach_cmd=cmd, ap_log=ap_log_stripped)
self.logger.debug("async-profiler log", extra={"jattach_cmd": cmd, "ap_log": ap_log_stripped})
return ap_log

def _run_fdtransfer(self) -> None:
Expand Down
6 changes: 3 additions & 3 deletions granulate_utils/gprofiler/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def start_process(
if isinstance(cmd, str):
cmd = [cmd]

logger.debug("Running command", command=cmd)
logger.debug("Running command", extra={"command": cmd})

env = kwargs.pop("env", None)
staticx_dir = get_staticx_dir()
Expand Down Expand Up @@ -303,13 +303,13 @@ def run_process(
result: CompletedProcess[bytes] = CompletedProcess(process.args, retcode, stdout, stderr)

# decoding stdout/stderr as latin-1 which should never raise UnicodeDecodeError.
extra: Dict[str, Any] = {"exit_code": result.returncode}
extra: Dict[str, Any] = {"exit_code": result.returncode, "command": process.args}
if not suppress_log:
if result.stdout:
extra["stdout"] = result.stdout.decode("latin-1")
if result.stderr:
extra["stderr"] = result.stderr.decode("latin-1")
logger.debug("Command exited", command=process.args, **extra)
logger.debug("Command exited", extra=extra)
if reraise_exc is not None:
raise reraise_exc
elif check and retcode != 0:
Expand Down

0 comments on commit c092236

Please sign in to comment.