Avoid printing binary in logs

The ByteArray may contain arbitrary bytes. Printing it to the logs
results in garbage and terminal emulators will try to interpret
escape codes.
This commit is contained in:
Simon Ser 2022-10-08 13:27:46 +02:00
parent fed1994497
commit 890e3b311c

View file

@ -10,7 +10,7 @@ import io.heckel.ntfy.util.Log
*/
class Distributor(val context: Context) {
fun sendMessage(app: String, connectorToken: String, message: ByteArray) {
Log.d(TAG, "Sending MESSAGE to $app (token=$connectorToken): ${String(message)} (${message.size} bytes)}")
Log.d(TAG, "Sending MESSAGE to $app (token=$connectorToken): ${message.size} bytes")
val broadcastIntent = Intent()
broadcastIntent.`package` = app
broadcastIntent.action = ACTION_MESSAGE