| 1 | #!/usr/local/bin/perl -w | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | use 5.012; | ||
| 6 | use autodie; | ||
| 7 | use Text::Cadenceparser; | ||
| 8 | |||
| 9 | if ( defined $ARGV[0] ) { | ||
| 10 | |||
| 11 | # Create the object | ||
| 12 | my $parser = Text::Cadenceparser->new( folder => $ARGV[0] ); | ||
| 13 | |||
| 14 | # Demo of reporting count | ||
| 15 | #my $count = $parser->count('info'); | ||
| 16 | #print "Found $count info messages\n"; | ||
| 17 | |||
| 18 | # Demo of printing the overview | ||
| 19 | say '----------------------------------------------------'; | ||
| 20 | say "Parsed logfiles in folder $ARGV[0], the result:"; | ||
| 21 | $parser->overview(); | ||
| 22 | |||
| 23 | # Demo of listing specific messages to STDOUT | ||
| 24 | $parser->list('warning'); | ||
| 25 | $parser->list('error'); | ||
| 26 | } else { | ||
| 27 | die | ||
| 28 | "Please pass the folder with the files that need to be parsed as command line option"; | ||
| 29 | } | ||
| 30 | |||
| 31 | # ABSTRACT: Create a short human-readable output of the synthesis logfiles | ||
| 32 | # PODNAME: synth_log.pl | ||
| 33 | |||
| 34 | __END__ |