aboutsummaryrefslogtreecommitdiff
path: root/src/callnotifier/Log.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/callnotifier/Log.php')
-rw-r--r--src/callnotifier/Log.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/callnotifier/Log.php b/src/callnotifier/Log.php
index d2ee0c8..a831066 100644
--- a/src/callnotifier/Log.php
+++ b/src/callnotifier/Log.php
@@ -3,6 +3,8 @@ namespace callnotifier;
class Log
{
+ public $debug = false;
+
/**
* Array of logger object arrays.
* Key is the notification type, value is an array of logger objects
@@ -33,6 +35,10 @@ class Log
}
$types = (array)$types;
+ if ($this->debug) {
+ $logger->debug = $this->debug;
+ }
+
foreach ($types as $type) {
if (!isset($this->logger[$type])) {
throw new \Exception('Unknown log type: ' . $type);
@@ -46,9 +52,12 @@ class Log
if (!isset($this->logger[$type])) {
throw new \Exception('Unknown log type: ' . $type);
}
-
+
if (count($this->logger[$type])) {
foreach ($this->logger[$type] as $logger) {
+ if ($this->debug) {
+ echo "Logging to " . get_class($logger) . "\n";
+ }
$logger->log($type, $arData);
}
}