1
0

- some debugging

- adding logs in mysql database
This commit is contained in:
2022-01-10 00:12:30 +01:00
parent 7acec3a3c4
commit cd20e973cd
5 changed files with 55 additions and 4 deletions

View File

@ -1,4 +1,7 @@
<?php
$title = "moha";
cli_set_process_title($title);
file_put_contents("/proc/".getmypid()."/comm",$title);
//Constants
define( "EOL", "\n");
@ -35,7 +38,7 @@ $logFile = "/var/log/moha.log"; // Path of log file
$logFh = null; // filehandle of log file
$curlErr = 0; // Number of errors returned by curl
$configDir = "./config"; // default config dir (production value is /etc/moha/)
$properties2log = array("action", "state", "contact", "temperature", "state_l1", "state_l2", "humidity", "current_heating_setpoint", "position", "pressure", "occupancy", "tamper", "illuminance_lux","illuminance", "requested_brightness_level", );
if (!init()) exit(1);
function logger($level, $log, $notif = true)
@ -93,6 +96,7 @@ logger(DEBUG, _("requiring php modules"), false);
require "utils.php";
require "mqtt_functions.php";
require "events.php";
require "db.php";
require "db_functions.php";
// topics definition