mirror-ghostty/include
Mitchell Hashimoto aa6943da37
libghostty: add log callback configuration
In C ABI builds, the Zig std.log default writes to stderr which is
not appropriate for a library. Override std_options.logFn with a
custom sink that dispatches to an embedder-provided callback, or
silently discards when none is registered.

Add GHOSTTY_SYS_OPT_LOG to ghostty_sys_set() following the existing
decode_png pattern. The callback receives the log level as a
GhosttySysLogLevel enum, scope and message as separate byte slices,
giving embedders full control over formatting and routing.

Export ghostty_sys_log_stderr as a built-in convenience callback that
writes to stderr using std.debug.lockStderrWriter for thread-safe
output. Embedders who want the old behavior can install it at startup
with a single ghostty_sys_set call.
2026-04-10 10:52:45 -07:00
..
ghostty libghostty: add log callback configuration 2026-04-10 10:52:45 -07:00
ghostty.h ghostty.h: guard sys/types.h include for MSVC 2026-03-31 02:40:33 +02:00
module.modulemap include: comment the modulemap 2023-02-19 10:44:53 -08:00