diff --git a/internal/secret/debug.go b/internal/secret/debug.go index 2935022..8912924 100644 --- a/internal/secret/debug.go +++ b/internal/secret/debug.go @@ -32,6 +32,9 @@ func initDebugLogging() { return } + // Disable stderr buffering for immediate debug output when debugging is enabled + syscall.Syscall(syscall.SYS_FCNTL, os.Stderr.Fd(), syscall.F_SETFL, syscall.O_SYNC) + // Check if STDERR is a TTY isTTY := term.IsTerminal(int(syscall.Stderr)) @@ -130,4 +133,4 @@ func (h *colorizedHandler) WithGroup(name string) slog.Handler { // For simplicity, return the same handler // In a more complex implementation, we'd create a new handler with the group return h -} \ No newline at end of file +}