mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
log all mtr output in vardir/log/stdout.log
despite the name, it logs both stdout and stderr
This commit is contained in:
23
mysql-test/lib/My/Tee.pm
Normal file
23
mysql-test/lib/My/Tee.pm
Normal file
@@ -0,0 +1,23 @@
|
||||
package My::Tee;
|
||||
|
||||
# see PerlIO::via
|
||||
|
||||
our $copyfh;
|
||||
|
||||
sub PUSHED
|
||||
{
|
||||
open($copyfh, '>', "$::opt_vardir/log/stdout.log")
|
||||
or die "open(>$::opt_vardir/log/stdout.log): $!"
|
||||
unless $copyfh;
|
||||
bless { }, shift;
|
||||
}
|
||||
|
||||
sub WRITE
|
||||
{
|
||||
my ($obj, $buf, $fh) = @_;
|
||||
print $fh $buf;
|
||||
print $copyfh $buf;
|
||||
return length($buf);
|
||||
}
|
||||
|
||||
1;
|
Reference in New Issue
Block a user