Skip to content

pv-runtime: Reduce redundancy in the log

Simon McVittie requested to merge wip/smcv/shorter-debug-log into main
  • pv-runtime: Remove redundant call to glnx_basename()

    We already called it and cached its result in a variable.

  • pv-exports: Abbreviate log messages when exporting symlink targets

    We don't need to give the full path to the temporary mutable sysroot (when we're using one) or a transient temp directory in /tmp (otherwise). It's enough to say:

      Exporting .../libfoo.so because overrides/lib/x86_64-linux-gnu/libfoo.so points to it

    This makes the log more concise, with less repetition, shorter lines, and less unnecessary noise when diff'ing two log files.

  • pv-runtime: Avoid logging "//" in paths to library directories

    pv_multiarch_details_get_libdirs() returns an array of absolute paths, so we can append them to a directory prefix with "%s%s".

  • pv-runtime: Log the name of the mutable sysroot once

    This gives us the necessary context to understand paths that are logged as relative to the mutable sysroot.

  • pv-runtime: Log the path to the mutable sysroot less often

  • pv-runtime: Abbreviate the unnecessary files we remove in debug log

    We don't need to give the full path to the temporary mutable sysroot: it's enough to say something like

      Deleting tmp-*/usr/lib/i386-linux-gnu/libc.so.6 because ...

    As well as making the log smaller, with shorter lines, this will remain consistent between similar runs, making it easier to see differences.

    We continue to use the full path in errors and warnings, on the basis that errors and warnings don't usually happen, and could have been caused by a problem with any path component (whether before or after the part that we exclude from debug messages).


This reduces my log file from around 300K to 280K, as well as reducing the diff.

Merge request reports

Loading