Skip to content

Commit

Permalink
Remove intermediate variables for conversion start/end logs
Browse files Browse the repository at this point in the history
Also, state that the logs are incomplete in the header.
  • Loading branch information
almet committed Jan 15, 2025
1 parent 8532688 commit 26c3d09
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions dangerzone/isolation_provider/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@

log = logging.getLogger(__name__)

DOC_TO_PIXELS_LOG_START = "----- DOC TO PIXELS LOG START -----"
DOC_TO_PIXELS_LOG_END = "----- DOC TO PIXELS LOG END -----"

TIMEOUT_EXCEPTION = 15
TIMEOUT_GRACE = 15
TIMEOUT_FORCE = 5
Expand Down Expand Up @@ -359,14 +356,13 @@ def doc_to_pixels_proc(
debug_bytes = stderr.getvalue()
debug_log = sanitize_debug_text(debug_bytes)

incomplete = "(incomplete)\n" if stderr_thread.is_alive() else ""
incomplete = "(incomplete) " if stderr_thread.is_alive() else ""

log.info(
"Conversion output (doc to pixels)\n"
f"{DOC_TO_PIXELS_LOG_START}\n"
f"----- DOC TO PIXELS LOG START ${incomplete}-----\n"
f"{debug_log}" # no need for an extra newline here
f"{incomplete}"
f"{DOC_TO_PIXELS_LOG_END}"
"----- DOC TO PIXELS LOG END -----"
)

def start_stderr_thread(
Expand Down

0 comments on commit 26c3d09

Please sign in to comment.