From be90f4ebf0bf92fa96b511c469b3e59703960e2c Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Tue, 5 Sep 2023 12:37:48 -0500 Subject: [PATCH] feat(wezterm): capture both stdout & stderr in system log --- dots/.config/wezterm/lib/log.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dots/.config/wezterm/lib/log.lua b/dots/.config/wezterm/lib/log.lua index 5f3ce566..dc2b6764 100644 --- a/dots/.config/wezterm/lib/log.lua +++ b/dots/.config/wezterm/lib/log.lua @@ -20,7 +20,7 @@ local function system_log(message, opts) local log_unit = "wezterm" if os_detected == "linux" then local handle = - io.popen(string.format("systemd-cat -t %s -p %s echo '%s'", log_unit, opts.level:lower(), message)) + io.popen(string.format("systemd-cat -t %s -p %s echo '%s' 2>&1", log_unit, opts.level:lower(), message)) if not opts.ignore_result or opts.ignore_result == nil then ---@diagnostic disable-next-line: need-check-nil local output = handle:read("*a") @@ -33,7 +33,7 @@ local function system_log(message, opts) local success = handle:close() if success == nil or not success then wezterm.log_warn( - string.format("'systemd-cat' did not indicate a successful run!\nHandle Output:\n%s", output) + string.format("'systemd-cat' did not indicate a successful run!\nHandle Output: %s", output) ) end end