But the module isn't flushing anything. The log messages just accumulate in memory until the internal buffer runs full.
Test code:
use strict;
use warnings;
use Log::Dispatch;
my $log = Log::Dispatch->new(
outputs => [
[
'Screen',
min_level => 'debug',
newline => 1,
stderr => 0,
],
],
);
for my $i (1 .. 10) {
$log->warning("message $i");
sleep 1;
}
Run it as perl try.pl | cat or strace perl try.pl > loggylog. In either case you can see the program sleep for 10 seconds, followed by a single write() containing all the output:
https://metacpan.org/release/DROLSKY/Log-Dispatch-2.70/view/lib/Log/Dispatch/Screen.pm says:
But the module isn't flushing anything. The log messages just accumulate in memory until the internal buffer runs full.
Test code:
Run it as
perl try.pl | cat
orstrace perl try.pl > loggylog
. In either case you can see the program sleep for 10 seconds, followed by a single write() containing all the output: