Skip to content

Instantly share code, notes, and snippets.

@ngs
Created November 11, 2010 18:18
Show Gist options
  • Select an option

  • Save ngs/672929 to your computer and use it in GitHub Desktop.

Select an option

Save ngs/672929 to your computer and use it in GitHub Desktop.
Watch FlashDev trace log
#!/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