X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FLog.pm;h=af80f7ab5e6f5d86b734bb27a6612f71e738ebf4;hb=8dbe4e810dd99058eeed761f1172c842ab8f9259;hp=e64d2369a371b131466dd7f8d7fdf3e4aae4e73b;hpb=8b4e1a9b732fe0d25d18d3fca592d9209ccbf6e1;p=debbugs.git 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: $!";