From 9e8bcff5ddfc7d3e5785161078c5b1eaafea2f1e Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 17 Jul 2009 18:36:13 -0700 Subject: [PATCH] Allow -d (debug logging) command line argument --- scripts/twitterstatusfetcher.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php index 248cf86f10..e2ba1d0031 100755 --- a/scripts/twitterstatusfetcher.php +++ b/scripts/twitterstatusfetcher.php @@ -25,19 +25,18 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); define('MAXCHILDREN', 2); define('POLL_INTERVAL', 60); // in seconds -$shortoptions = 'i::'; -$longoptions = array('id::'); +$shortoptions = 'di::'; +$longoptions = array('id::', 'debug'); $helptext = <<name() . + ': debugging log output enabled.'); + } + do { $flinks = $this->refreshFlinks(); @@ -649,7 +653,9 @@ if (have_option('i')) { $id = null; } -common_debug("id set to $id"); +if (have_option('d') || have_option('debug')) { + define('SCRIPT_DEBUG', true); +} $fetcher = new TwitterStatusFetcher($id); $fetcher->runOnce();