Use os_log to report get_argv failures on Apple

This commit is contained in:
Kovid Goyal
2025-04-27 10:42:43 +05:30
parent 9ff9e50936
commit 65d97e2379
2 changed files with 11 additions and 1 deletions

View File

@@ -55,8 +55,10 @@ log_error(const char *fmt, ...) {
if (!use_os_log) { // Apple's os_log already records timestamps
fprintf(stderr, "[%.3f] ", monotonic_t_to_s_double(monotonic()));
}
// To see os_log messages from kitty, use:
// log show --predicate 'processImagePath contains "kitty"'
#ifdef __APPLE__
if (use_os_log) os_log(OS_LOG_DEFAULT, "%{public}s", sanbuf);
if (use_os_log) os_log_error(OS_LOG_DEFAULT, "%{public}s", sanbuf);
#endif
if (!use_os_log) fprintf(stderr, "%s\n", sanbuf);
#undef bufprint