X-Git-Url: https://git.cweiske.de/auerswald-callnotifier.git/blobdiff_plain/378a3adf9811b27980efd03dd8a51d9fe00258ca..6ec5a125940846a9f7f1bb31d55b19e044db2c09:/src/callnotifier/Logger/CallBase.php diff --git a/src/callnotifier/Logger/CallBase.php b/src/callnotifier/Logger/CallBase.php index 31ad0bc..2a1d3e8 100644 --- a/src/callnotifier/Logger/CallBase.php +++ b/src/callnotifier/Logger/CallBase.php @@ -6,6 +6,7 @@ abstract class Logger_CallBase implements Logger protected $callTypes; protected $msns; + public $debug = false; /** * Create a new call logger. @@ -33,9 +34,11 @@ abstract class Logger_CallBase implements Logger protected function hasValidType($call) { if ($call->type == CallMonitor_Call::INCOMING && $this->callTypes == 'o') { + $this->debug('No valid call type (requested: o)'); return false; } if ($call->type == CallMonitor_Call::OUTGOING && $this->callTypes == 'i') { + $this->debug('No valid call type (requested: i)'); return false; } @@ -56,6 +59,7 @@ abstract class Logger_CallBase implements Logger } if (count($this->msns) > 0 && !in_array($msn, $this->msns)) { //msn shall not be logged + $this->debug('No valid MSN (requested: ' . $msn . ')'); return false; } @@ -100,6 +104,13 @@ abstract class Logger_CallBase implements Logger return str_pad($number, 12, ' ', STR_PAD_RIGHT); } + protected function debug($msg) + { + if (!$this->debug) { + return; + } + echo $msg . "\n"; + } } ?>