From 7bcfd7b37974fc1ce0fa6020117a6320f8451bfc Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 26 Nov 2021 12:00:16 +0000 Subject: [PATCH] set autoflush on stderr so that logging to systemd's journal (via UNIX socket) is more real-time --- bin/mpd-feeder | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/mpd-feeder b/bin/mpd-feeder index ffb7994..29a6d5b 100755 --- a/bin/mpd-feeder +++ b/bin/mpd-feeder @@ -8,6 +8,12 @@ use App::MPD::Feeder; use Log::Any qw($log); use Log::Any::Adapter Stderr => log_level => 'error'; +{ # autoflush without IO::Handle + my $fh = select STDERR; + $| = 1; + select $fh; +} + my $feeder = App::MPD::Feeder->new(); if (@ARGV) { -- 2.39.5