Skip to content

Commit

Permalink
move tool logs to the front of archive
Browse files Browse the repository at this point in the history
This moves the tool's logs to the front of the tar archive rather than
the tail. As tar is a stream format, having them at the tail ends up
requiring that automation read the archive twice: once to gather details
crucial to routing and parsing the data it contains, and once to actually
parse the data.

Most solutions will likely still want to read archives twice in order to
handle ones generated before this change, but at least they can
terminate the first pass when they finish parsing the log file, thus
minimizing waste.
  • Loading branch information
rbcrwd committed Apr 10, 2024
1 parent 0eed042 commit 1ed4fb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions uac
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,9 @@ ua_output_file_hash="-"
# sort and uniq
sort_uniq_file "${TEMP_DATA_DIR}/.output_file.tmp" 2>>"${UAC_STDERR_LOG_FILE}"
# add uac.log to the list of files to be archived/copied within the output file
echo "uac.log" >>"${TEMP_DATA_DIR}/.output_file.tmp"
echo "uac.log" | cat - "${TEMP_DATA_DIR}/.output_file.tmp" >"${TEMP_DATA_DIR}/.output_file.tmp"
# add uac.log.stderr to the list of files to be archived/copied within the output file
echo "uac.log.stderr" >>"${TEMP_DATA_DIR}/.output_file.tmp"
echo "uac.log.stderr" | cat - "${TEMP_DATA_DIR}/.output_file.tmp" >"${TEMP_DATA_DIR}/.output_file.tmp"

# create output file
if command_exists "tar"; then
Expand Down

0 comments on commit 1ed4fb2

Please sign in to comment.