Skip to content

run-outside-ldlp: Do basic logging initialization before parsing arguments

Simon McVittie requested to merge wip/task489-log into main
  • run-outside-ldlp: Do basic logging initialization before parsing arguments

    _srt_log_failure() uses a custom log level that is understood by our log handler, so it doesn't work until we have set our log handler, which we do the first time _srt_util_set_glib_log_handler() is called. If we fail and early-return before the log handler is set, that leads to errors being reported strangely:

      $ srt-run-outside-ldlp --wrong
      steam-runtime-tools-LOG-0x100: 21:28:47.912: Unknown option --wrong

    Not setting the program name also meant that we'd log as (null), for example:

      (null)[12345]: I: Found 'cat' at /usr/bin/cat

    or possibly crash if somehow run with a less tolerant libc.

    Fixes: ecaade46 "run-outside-ldlp: Add new tool for escaping the LDLP runtime"

Edited by Simon McVittie

Merge request reports

Loading