1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

Further improve displaying of individual logfiles

This commit is contained in:
Yang Tse 2007-04-05 00:14:27 +00:00
parent c321b9f704
commit 70f9a13ecb

View File

@ -2426,10 +2426,23 @@ open(CMDLOG, ">$CURLLOG") ||
sub displaylogcontent {
my ($file)=@_;
if(open(my $SINGLE, "<$file")) {
while(my $line = <$SINGLE>) {
chomp $line;
$line =~ s/\s*\!$//;
logmsg " $line\n";
my $lfcount;
while(my $string = <$SINGLE>) {
$string =~ s/\r\n/\n/g;
$string =~ s/[\r\f\032]/\n/g;
$string .= "\n" unless ($string =~ /\n$/);
$lfcount = $string =~ tr/\n//;
if($lfcount == 1) {
$string =~ s/\n//;
$string =~ s/\s*\!$//;
logmsg " $string\n";
}
else {
for my $line (split("\n", $string)) {
$line =~ s/\s*\!$//;
logmsg " $line\n";
}
}
}
close($SINGLE);
}