Package list python-procrunner / 45f1ebb
Use logging internal string formatting Markus Gerstel 1 year, 4 months ago
1 changed file(s) with 12 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
180180 if not self.has_finished():
181181 if self._debug:
182182 logger.debug(
183 "NBSR join after %f seconds, underrun not resolved"
184 % (timeit.default_timer() - underrun_debug_timer)
183 "NBSR join after %f seconds, underrun not resolved",
184 timeit.default_timer() - underrun_debug_timer,
185185 )
186186 raise Exception("thread did not terminate")
187187 if self._debug:
188188 logger.debug(
189 "NBSR underrun resolved after %f seconds"
190 % (timeit.default_timer() - underrun_debug_timer)
189 "NBSR underrun resolved after %f seconds",
190 timeit.default_timer() - underrun_debug_timer,
191191 )
192192 if self._closed:
193193 raise Exception("streamreader double-closed")
232232 raise
233233 self._buffer_pos += len(block)
234234 if debug:
235 logger.debug("wrote %d bytes to stream" % len(block))
235 logger.debug("wrote %d bytes to stream", len(block))
236236 self._stream.close()
237237 self._terminated = True
238238 if notify:
526526 (timeout is None) or (timeit.default_timer() < max_time)
527527 ):
528528 if debug and timeout is not None:
529 logger.debug("still running (T%.2fs)" % (timeit.default_timer() - max_time))
529 logger.debug("still running (T%.2fs)", timeit.default_timer() - max_time)
530530
531531 # wait for some time or until a stream is closed
532532 try:
560560 # timeout condition
561561 timeout_encountered = True
562562 if debug:
563 logger.debug("timeout (T%.2fs)" % (timeit.default_timer() - max_time))
563 logger.debug("timeout (T%.2fs)", timeit.default_timer() - max_time)
564564
565565 # send terminate signal and wait some time for buffers to be read
566566 p.terminate()
586586 runtime = timeit.default_timer() - start_time
587587 if timeout is not None:
588588 logger.debug(
589 "Process ended after %.1f seconds with exit code %d (T%.2fs)"
590 % (runtime, p.returncode, timeit.default_timer() - max_time)
589 "Process ended after %.1f seconds with exit code %d (T%.2fs)",
590 runtime,
591 p.returncode,
592 timeit.default_timer() - max_time,
591593 )
592594 else:
593595 logger.debug(
594 "Process ended after %.1f seconds with exit code %d"
595 % (runtime, p.returncode)
596 "Process ended after %.1f seconds with exit code %d", runtime, p.returncode
596597 )
597598
598599 stdout = stdout.get_output()