added error log for the submission of sensor data
This commit is contained in:
parent
7392f66e11
commit
db8b1f3074
1 changed files with 6 additions and 0 deletions
|
@ -37,6 +37,12 @@ if (isset($_GET['locId'])) {
|
||||||
$sensorData = json_decode($_POST['submitSensorData'], true);
|
$sensorData = json_decode($_POST['submitSensorData'], true);
|
||||||
$ret = $blueweather->processSensorData($sensorData);
|
$ret = $blueweather->processSensorData($sensorData);
|
||||||
$data = $ret;
|
$data = $ret;
|
||||||
|
if ($ret['status'] !== 200) {
|
||||||
|
$log = "\n[".date("M,d,Y h:i:s A")."] ret: ".json_encode($ret)." request: ".json_encode($_POST['submitSensorData']);
|
||||||
|
//echo $log;
|
||||||
|
file_put_contents("./error.log" ,$log, FILE_APPEND);
|
||||||
|
}
|
||||||
|
|
||||||
} elseif (isset($_GET['command'])) {
|
} elseif (isset($_GET['command'])) {
|
||||||
// some user-data api request
|
// some user-data api request
|
||||||
$request = json_decode($_GET['command'], true);
|
$request = json_decode($_GET['command'], true);
|
||||||
|
|
Loading…
Reference in a new issue