From 039759ceaf541f1368afa731b8205a9e9db4add9 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Fri, 20 Jan 2023 18:29:40 +0200 Subject: [PATCH] bluez5: use spa_debug_log_mem, not spa_log_hexdump --- spa/plugins/bluez5/midi-node.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/spa/plugins/bluez5/midi-node.c b/spa/plugins/bluez5/midi-node.c index 12b8dbf19..d35975068 100644 --- a/spa/plugins/bluez5/midi-node.c +++ b/spa/plugins/bluez5/midi-node.c @@ -54,6 +54,9 @@ #include #include +#include +#include + #include "midi.h" #include "bluez5-interface-gen.h" @@ -544,8 +547,7 @@ again: } spa_log_trace(this->log, "%p: port:%d recv data size:%d", this, port->direction, size); - if (SPA_UNLIKELY(spa_log_level_topic_enabled(this->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_TRACE))) - spa_log_hexdump(this->log, SPA_LOG_LEVEL_DEBUG, 4, this->read_buffer, size); + spa_debug_log_mem(this->log, SPA_LOG_LEVEL_TRACE, 4, this->read_buffer, size); if (port->direction != SPA_DIRECTION_OUTPUT) { /* Just monitor errors for the input port */ @@ -646,8 +648,7 @@ again: spa_bt_midi_parser_init(&this->parser); spa_log_info(this->log, "BLE MIDI data packet parsing failed: %d", res); - if (spa_log_level_topic_enabled(this->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_DEBUG)) - spa_log_hexdump(this->log, SPA_LOG_LEVEL_DEBUG, 4, this->read_buffer, size); + spa_debug_log_mem(this->log, SPA_LOG_LEVEL_DEBUG, 4, this->read_buffer, size); } return; @@ -757,7 +758,6 @@ static int process_output(struct impl *this) static int flush_packet(struct impl *this) { struct port *port = &this->ports[PORT_IN]; - bool log_enabled = spa_log_level_topic_enabled(this->log, SPA_LOG_TOPIC_DEFAULT, SPA_LOG_LEVEL_TRACE); int res; if (this->writer.size == 0) @@ -769,9 +769,7 @@ static int flush_packet(struct impl *this) return -errno; spa_log_trace(this->log, "%p: send packet size:%d", this, this->writer.size); - if (log_enabled) - spa_log_hexdump(this->log, SPA_LOG_LEVEL_TRACE, 4, - this->writer.buf, this->writer.size); + spa_debug_log_mem(this->log, SPA_LOG_LEVEL_TRACE, 4, this->writer.buf, this->writer.size); return 0; }