Created
November 11, 2010 18:18
-
-
Save ngs/672929 to your computer and use it in GitHub Desktop.
Watch FlashDev trace log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl -w | |
| use strict; | |
| use warnings; | |
| use FileHandle; | |
| use Getopt::Long; | |
| my $file = $ENV{FLASH_LOG}; | |
| my $filter = undef; | |
| GetOptions( 'filter|f=s' => \$filter ); | |
| die 'No flash log' unless $file; | |
| my $fh = FileHandle->new($file,"w"); | |
| $fh->write(""); | |
| $fh->close; | |
| my $sys = "tail -f '$file'"; | |
| print "Starting tail $file\n"; | |
| if($filter) { | |
| $sys = "$sys | grep $filter"; | |
| print qq{Filter is "$filter"\n}; | |
| } | |
| system($sys); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment