Skip to content

Commit

Permalink
Debugging is helpful
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref committed Jan 25, 2024
1 parent 0b91906 commit 339ccb3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions extract-errors.pl
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#!/usr/bin/env perl
my $source_file = $ENV{source};
my $errors_file = $ENV{errors};
my $new_source_file = "$source_file.new";
open my $source_in, "<", $source_file;
open my $source_out, ">", $new_source_file;
open my $errors, ">>", $source_file;
open my $errors, ">>", $errors_file;
my $found_error=0;
while (<$source_in>) {
if ($found_error) {
print STDERR "[$source_file -> $errors] $_";
print STDERR "[$source_file -> $errors_file] $_";
print $errors $_;
} elsif (/^error:/) {
print STDERR "[$source_file --> $errors] $_";
print STDERR "[$source_file --> $errors_file] $_";
$found_error=1;
print $errors $_;
} else {
Expand Down

0 comments on commit 339ccb3

Please sign in to comment.