Skip to content
Snippets Groups Projects
  1. Aug 05, 2024
  2. Aug 02, 2024
  3. Aug 01, 2024
  4. Jul 31, 2024
  5. Jul 26, 2024
  6. Jul 25, 2024
    • Simon McVittie's avatar
      logger: Propagate error through _srt_syslog_level_parse · 0708ef7a
      Simon McVittie authored
      
      If parsing fails, we'd like to know why.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      0708ef7a
    • Simon McVittie's avatar
      logger: Add an early call to g_ascii_strtoull() to avoid a GLib bug · 85ab034a
      Simon McVittie authored
      
      There is a difficult-to-reproduce failure mode in which
      g_ascii_string_to_unsigned() can fail to parse a valid integer, which
      was causing our tests to fail (but only on i386 and only in a specific
      non-interactive build environment). As far as I can make out, this is
      an error-handling issue in the way g_ascii_string_to_unsigned() calls
      g_ascii_strtoull(): if newlocale() clobbers errno (which it is within
      its rights to do, according to the usual errno conventions), then
      g_ascii_strtoull() would interpret that as a strtoull_l() failure.
      
      We can work around this by ensuring that our first call to
      g_ascii_strtoull() is one that doesn't matter, so that by the time we
      actually call g_ascii_string_to_unsigned(), the cached C locale object
      inside GLib has already been initialized.
      
      steamrt/tasks#481
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      85ab034a
    • Simon McVittie's avatar
      Add test coverage for _srt_syslog_level_parse() · 8f2d8c9e
      Simon McVittie authored
      
      steamrt/tasks#481
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      8f2d8c9e
    • Simon McVittie's avatar
      tests: Add sample code to print GLib messages with a priority prefix · de2f4173
      Simon McVittie authored
      
      Something similar to this could be used inside `steamwebhelper` and
      other Steam executables that are linked to GLib, if desired.
      
      Followup for steamrt/tasks#444.
      
      Typical output:
      
      ```
      <3>priority-logwriter [main] internal error: this is a mockup of a critical warning
      <4>priority-logwriter [main] warning: this is a mockup of an ordinary warning
      <5>priority-logwriter [main] this is a mockup of a somewhat important message
      <5>priority-logwriter [main] this message
      <5>contains
      <5>multiple
      <5>lines
      <6>priority-logwriter [main] this is a mockup of an informational message
      <7>priority-logwriter [main] this is a mockup of a debug message
      <3>priority-logwriter [MyLib] (old log API) internal error: this is a mockup of a critical warning from a library
      <4>priority-logwriter [MyLib] (old log API) warning: this is a mockup of an ordinary warning from a library
      <5>priority-logwriter [MyLib] (old log API) this is a mockup of a somewhat important message from a library
      <5>priority-logwriter [MyLib] (old log API) this message
      <5>contains
      <5>multiple
      <5>lines
      <6>priority-logwriter [MyLib] (old log API) this is a mockup of an informational message from a library
      <7>priority-logwriter [MyLib] (old log API) this is a mockup of a debug message from a library
      <5>priority-logwriter [MyLib] Structured message: Invalid cross-device link [errno 18]
      ```
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      de2f4173
    • Simon McVittie's avatar
      log: Optionally prepend a priority level marker to each message · 80bdc480
      Simon McVittie authored
      
      If we're running under `srt-logger --parse-level-prefix`, it becomes
      useful for our tools to emit priority level markers on their diagnostic
      messages. In particular, we want pressure-vessel to tag its warning and
      error messages with one of these markers.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      80bdc480
    • Simon McVittie's avatar
  7. Jul 24, 2024
  8. Jul 23, 2024
  9. Jul 22, 2024
  10. Jul 19, 2024
Loading