[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [OSSTEST PATCH 2/3] TestSupport: logm: allow $logm_handle to be an aref
If $logm_handle is an array reference, iterate over it. This allows calling code to duplicate the messages. Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> --- Osstest/TestSupport.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 31748b1..b2f0b22 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -175,11 +175,14 @@ sub ts_get_host_guest { # pass this @ARGV sub logm ($) { my ($m) = @_; my @t = gmtime; - printf $logm_handle "%04d-%02d-%02d %02d:%02d:%02d Z %s\n", - $t[5]+1900,$t[4]+1,$t[3], $t[2],$t[1],$t[0], - $m - or die $!; - $logm_handle->flush or die $!; + my $fm = sprintf "%04d-%02d-%02d %02d:%02d:%02d Z %s\n", + $t[5]+1900,$t[4]+1,$t[3], $t[2],$t[1],$t[0], + $m; + foreach my $h ((ref($logm_handle) eq 'ARRAY') + ? @$logm_handle : $logm_handle) { + print $h $fm or die $!; + $h->flush or die $!; + } } sub fail ($) { -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |