write debug to log

master
Dirk Heilig 2024-09-23 14:06:39 +02:00
parent 13a23d43ad
commit 55989ff7f6
1 changed files with 7 additions and 12 deletions

View File

@ -64,7 +64,6 @@ $mqtt->onMessage(function ($message) use (
&$news, &$news,
&$globalCounter, &$globalCounter,
&$isRunning, &$isRunning,
$mqtt,
$mqttTopic $mqttTopic
) { ) {
if ($mqttTopic . "/restart" === $message->topic) { if ($mqttTopic . "/restart" === $message->topic) {
@ -72,17 +71,13 @@ $mqtt->onMessage(function ($message) use (
return; return;
} }
if ($mqttTopic . "/debug" === $message->topic) { if ($mqttTopic . "/debug" === $message->topic) {
$mqtt->publish( logit(
$mqttTopic . "/debugmsg",
strval(
json_encode( json_encode(
$data, $data,
JSON_UNESCAPED_SLASHES + JSON_UNESCAPED_SLASHES +
JSON_UNESCAPED_UNICODE + JSON_UNESCAPED_UNICODE +
JSON_PRETTY_PRINT JSON_PRETTY_PRINT
) )
),
2
); );
return; return;
} }