diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2012-07-25 18:19:25 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2012-07-25 18:19:25 +0200 |
| commit | 522f718ee8a0be219a54ba0650f1b82b6cea3d34 (patch) | |
| tree | c9ea3b61c4f67549c6d99f6f19933d2517b0e572 /src | |
| parent | 1745804d9bb19325e5c76b054680bd3408176dfe (diff) | |
| download | auerswald-callnotifier-522f718ee8a0be219a54ba0650f1b82b6cea3d34.tar.gz auerswald-callnotifier-522f718ee8a0be219a54ba0650f1b82b6cea3d34.zip | |
add cli option to activate debug log
Diffstat (limited to 'src')
| -rw-r--r-- | src/callnotifier/CLI.php | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/callnotifier/CLI.php b/src/callnotifier/CLI.php index c8c8573..55f7f71 100644 --- a/src/callnotifier/CLI.php +++ b/src/callnotifier/CLI.php @@ -24,7 +24,13 @@ class CLI $this->fillConfig($this->config, $result); $handler = new MessageHandler($this->config); - $handler->addLogger(new Logger_Debug(), '*'); + if ($result->options['debug'] || $result->options['debugEdss1']) { + $debugLogger = new Logger_Debug(); + $handler->addLogger($debugLogger, '*'); + if ($result->options['debugEdss1']) { + $debugLogger->edss1MsgOnly = true; + } + } if ($this->config->replayFile !== null) { $sourceClass = 'callnotifier\Source_File'; @@ -71,6 +77,25 @@ class CLI ) ); + $p->addOption( + 'debug', + array( + 'short_name' => '-d', + 'long_name' => '--debug', + 'description' => "Debug mode: Echo all received messages and events", + 'action' => 'StoreTrue' + ) + ); + $p->addOption( + 'debugEdss1', + array( + 'short_name' => '-e', + 'long_name' => '--debug-edss1', + 'description' => "Debug mode: Show EDSS1 messages only", + 'action' => 'StoreTrue' + ) + ); + $this->cliParser = $p; } |
