From: Don Armstrong Date: Fri, 6 Aug 2010 06:32:03 +0000 (-0400) Subject: fix appending to log and use croak in a different place X-Git-Tag: release/2.6.0~415^2~23 X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=8dbe4e810dd99058eeed761f1172c842ab8f9259 fix appending to log and use croak in a different place --- diff --git a/Debbugs/Log.pm b/Debbugs/Log.pm index e64d236..af80f7a 100644 --- a/Debbugs/Log.pm +++ b/Debbugs/Log.pm @@ -368,7 +368,7 @@ sub write_log_records $logfh = $param{logfh} } elsif (exists $param{log_name}) { - $logfh = IO::File->new($param{log_name},'w') or + $logfh = IO::File->new(">>$param{log_name}") or die "Unable to open bug log $param{log_name} for writing: $!"; } elsif (exists $param{bug_num}) { @@ -381,8 +381,8 @@ sub write_log_records for my $record (@records) { my $type = $record->{type}; + croak "record type '$type' with no text field" unless defined $record->{text}; my ($text) = escape_log($record->{text}); - croak "record type '$type' with no text field" unless defined $text; if ($type eq 'autocheck') { print {$logfh} "\01\n$text\03\n" or die "Unable to write to logfile: $!";