add more logs

master
Dirk Heilig 2024-09-23 11:50:08 +02:00
parent e1877d6761
commit baafedbf88
1 changed files with 5 additions and 1 deletions

View File

@ -85,13 +85,17 @@ $mqtt->onMessage(function ($message) use (
$payload["timestamp"] = time(); $payload["timestamp"] = time();
$data[] = $payload; $data[] = $payload;
$news = true; $news = true;
$v = [];
foreach ($$payload["labels"] as $key => $value) {
$v[] = $key . "=" . $value;
}
logit( logit(
"got message for " . "got message for " .
$payload["name"] . $payload["name"] .
": " . ": " .
implode(", ", $payload["labels"]) . implode(", ", $payload["labels"]) .
" with value " . " with value " .
$payload["value"] implode(", ", $v)
); );
}); });