File tree Expand file tree Collapse file tree
granulate_utils/gprofiler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ def get_java_version_logged(
352352 logger : Union [logging .LoggerAdapter , logging .Logger ],
353353) -> Optional [str ]:
354354 java_version = get_java_version (process , stop_event , logger )
355- logger .debug ("java -version output" , java_version_output = java_version , pid = process .pid )
355+ logger .debug ("java -version output" , extra = { "java_version_output" : java_version , " pid" : process .pid } )
356356 return java_version
357357
358358
@@ -678,7 +678,7 @@ def _run_async_profiler(self, cmd: List[str]) -> str:
678678 else :
679679 ap_log = self ._read_ap_log ()
680680 ap_log_stripped = MEM_INFO_LOG_RE .sub ("" , ap_log ) # strip out mem info log only when for gProfiler log
681- self .logger .debug ("async-profiler log" , jattach_cmd = cmd , ap_log = ap_log_stripped )
681+ self .logger .debug ("async-profiler log" , extra = { "jattach_cmd" : cmd , " ap_log" : ap_log_stripped } )
682682 return ap_log
683683
684684 def _run_fdtransfer (self ) -> None :
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ def start_process(
114114 if isinstance (cmd , str ):
115115 cmd = [cmd ]
116116
117- logger .debug ("Running command" , command = cmd )
117+ logger .debug ("Running command" , extra = { "command" : cmd } )
118118
119119 env = kwargs .pop ("env" , None )
120120 staticx_dir = get_staticx_dir ()
@@ -303,13 +303,13 @@ def run_process(
303303 result : CompletedProcess [bytes ] = CompletedProcess (process .args , retcode , stdout , stderr )
304304
305305 # decoding stdout/stderr as latin-1 which should never raise UnicodeDecodeError.
306- extra : Dict [str , Any ] = {"exit_code" : result .returncode }
306+ extra : Dict [str , Any ] = {"exit_code" : result .returncode , "command" : process . args }
307307 if not suppress_log :
308308 if result .stdout :
309309 extra ["stdout" ] = result .stdout .decode ("latin-1" )
310310 if result .stderr :
311311 extra ["stderr" ] = result .stderr .decode ("latin-1" )
312- logger .debug ("Command exited" , command = process . args , ** extra )
312+ logger .debug ("Command exited" , extra = extra )
313313 if reraise_exc is not None :
314314 raise reraise_exc
315315 elif check and retcode != 0 :
You can’t perform that action at this time.
0 commit comments