git.cweiske.de
/
auerswald-callnotifier.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1745804
)
add cli option to activate debug log
author
Christian Weiske
<cweiske@cweiske.de>
Wed, 25 Jul 2012 16:19:25 +0000
(18:19 +0200)
committer
Christian Weiske
<cweiske@cweiske.de>
Wed, 25 Jul 2012 16:19:25 +0000
(18:19 +0200)
src/callnotifier/CLI.php
patch
|
blob
|
history
diff --git
a/src/callnotifier/CLI.php
b/src/callnotifier/CLI.php
index c8c85736b81aed40d80b4a724c87414a1c889960..55f7f71847aafd812809f3d70dec5a0f1da858fb 100644
(file)
--- 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);
$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';
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;
}
$this->cliParser = $p;
}