feat(wezterm): capture both stdout & stderr in system log
This commit is contained in:
parent
ccfbc6b226
commit
be90f4ebf0
@ -20,7 +20,7 @@ local function system_log(message, opts)
|
|||||||
local log_unit = "wezterm"
|
local log_unit = "wezterm"
|
||||||
if os_detected == "linux" then
|
if os_detected == "linux" then
|
||||||
local handle =
|
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
|
if not opts.ignore_result or opts.ignore_result == nil then
|
||||||
---@diagnostic disable-next-line: need-check-nil
|
---@diagnostic disable-next-line: need-check-nil
|
||||||
local output = handle:read("*a")
|
local output = handle:read("*a")
|
||||||
@ -33,7 +33,7 @@ local function system_log(message, opts)
|
|||||||
local success = handle:close()
|
local success = handle:close()
|
||||||
if success == nil or not success then
|
if success == nil or not success then
|
||||||
wezterm.log_warn(
|
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
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user