1
0

debugging

This commit is contained in:
2022-01-28 23:05:58 +01:00
parent 1361cb9395
commit 425107cec7
22 changed files with 167 additions and 136 deletions

View File

@ -1,6 +1,6 @@
<?php
logger(DEBUG,"Including db_functions.php");
logger(DEBUG,_("Including db_functions.php"), __FILE__ . ":" . __LINE__);
// to save or not to save the DB, that is the question ...
function storeDB($db, $filepath)
@ -58,7 +58,7 @@ function mkDevicesDB($topic, $json, $group=false)
fwrite($logFh, print_r($devices, true));
fwrite($logFh, "################################END##################################################");
echo "Devices DB made" . EOL;
logger(DEBUG, _("Devices DB made"), __FILE__ . ":" . __LINE__);
//print_r($devices);
}
@ -125,7 +125,7 @@ function changeDevice($topic, $fn, &$device, $payloadArray)
iterateDevice($topic, $fn, $device, $device, $payloadArray);
}else
{
logger(ERROR, _("payloadArray is empty!"));
logger(ERROR, _("payloadArray is empty!"), __FILE__ . ":" . __LINE__);
}
}
@ -205,11 +205,11 @@ function iterateDevice($topic, $fn, $parentDevice, &$device, $payloadArray, $pro
$device->$key["value"] = $value;
//$changed[$fn]["key"] = $key;
//$changed[$fn]["value"] = $value;
logger(INFO, sprintf(_("Device %s property %s, %s"), $fn, $propertyTree . $key, bool2string($value)));
logger(INFO, sprintf(_("Device %s property %s, %s"), $fn, $propertyTree . $key, bool2string($value)), __FILE__ . ":" . __LINE__);
$mohaDB->logProperty($parentDevice, $propertyTree . $key, $value, $oldValue);
if (!empty($device->$key["functions"]))
{
logger(DEBUG,_("executing notifications functions"));
logger(DEBUG,_("executing notifications functions"), __FILE__ . ":" . __LINE__);
foreach($device->$key["functions"] as $function)
{
$function($device, $key, $value);