From 55989ff7f61d4cde71544367f0e33bd564e0155b Mon Sep 17 00:00:00 2001 From: Dirk Heilig Date: Mon, 23 Sep 2024 14:06:39 +0200 Subject: [PATCH] write debug to log --- mqtt2prom/run | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/mqtt2prom/run b/mqtt2prom/run index 561629c..090ee88 100755 --- a/mqtt2prom/run +++ b/mqtt2prom/run @@ -64,7 +64,6 @@ $mqtt->onMessage(function ($message) use ( &$news, &$globalCounter, &$isRunning, - $mqtt, $mqttTopic ) { if ($mqttTopic . "/restart" === $message->topic) { @@ -72,17 +71,13 @@ $mqtt->onMessage(function ($message) use ( return; } if ($mqttTopic . "/debug" === $message->topic) { - $mqtt->publish( - $mqttTopic . "/debugmsg", - strval( - json_encode( - $data, - JSON_UNESCAPED_SLASHES + - JSON_UNESCAPED_UNICODE + - JSON_PRETTY_PRINT - ) - ), - 2 + logit( + json_encode( + $data, + JSON_UNESCAPED_SLASHES + + JSON_UNESCAPED_UNICODE + + JSON_PRETTY_PRINT + ) ); return; }