From: Ian Jackson Subject: [OSSTEST PATCH 2/9] ts-hosts-allocate-Executive: allow uncompressed log Date: Tue, 11 Nov 2014 19:41:43 +0000 Message-ID: <1415734910-4647-3-git-send-email-ian.jackson@eu.citrix.com> References: <1415734910-4647-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XoHKE-0005iu-4f for xen-devel@lists.xenproject.org; Tue, 11 Nov 2014 19:42:05 +0000 In-Reply-To: <1415734910-4647-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Jackson --- ts-hosts-allocate-Executive | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive index 0e9c193..73c1a45 100755 --- a/ts-hosts-allocate-Executive +++ b/ts-hosts-allocate-Executive @@ -29,12 +29,14 @@ tsreadconfig(); open DEBUG, ">/dev/null" or die $!; +our $compressdebug=1; + while (@ARGV and $ARGV[0] =~ m/^-/) { $_= shift @ARGV; last if m/^--$/; while (m/^-./) { - if (0) { - # no options + if (s/^-U/-/) { + $compressdebug=0; } else { die "$_ ?"; } @@ -60,12 +62,16 @@ sub setup () { $taskid= findtask(); - my $logbase = "hosts-allocate.debug.gz"; + my $logbase = "hosts-allocate.debug".($compressdebug?".gz":""); my $logfh = open_unique_stashfile \$logbase; - my $logchild = open DEBUG, "|-"; defined $logchild or die $!; - if (!$logchild) { - open STDOUT, ">&", $logfh or die $!; - exec "gzip" or die $!; + if ($compressdebug) { + my $logchild = open DEBUG, "|-"; defined $logchild or die $!; + if (!$logchild) { + open STDOUT, ">&", $logfh or die $!; + exec "gzip" or die $!; + } + } else { + open DEBUG, ">&", $logfh or die $!; } DEBUG->autoflush(1); logm("host allocation debug log in $logbase"); -- 1.7.10.4