spa: use log topics everywhere

Use log topics properly everywhere, convert from "#define NAME".
This commit is contained in:
Pauli Virtanen 2024-03-10 17:32:56 +02:00
parent c963ca47c1
commit e784de3933
27 changed files with 170 additions and 102 deletions

View file

@ -27,7 +27,9 @@
#include "jack-client.h"
#define NAME "jack-sink"
#undef SPA_LOG_TOPIC_DEFAULT
#define SPA_LOG_TOPIC_DEFAULT &log_topic
SPA_LOG_TOPIC_DEFINE_STATIC(log_topic, "spa.jack-sink");
#define MAX_PORTS 128
#define MAX_BUFFERS 8
@ -404,7 +406,7 @@ static int init_ports(struct impl *this)
NULL, JACK_DEFAULT_AUDIO_TYPE,
JackPortIsPhysical|JackPortIsInput);
if (ports == NULL) {
spa_log_error(this->log, NAME" %p: can't enumerate ports", this);
spa_log_error(this->log, "%p: can't enumerate ports", this);
res = -ENODEV;
goto exit;
}
@ -421,7 +423,7 @@ static int init_ports(struct impl *this)
jack_port_type(p),
JackPortIsOutput, 0);
if (port->jack_port == NULL) {
spa_log_error(this->log, NAME" %p: jack_port_register() %d (%s) failed",
spa_log_error(this->log, "%p: jack_port_register() %d (%s) failed",
this, i, ports[i]);
res = -EFAULT;
goto exit_free;
@ -452,7 +454,7 @@ static int init_ports(struct impl *this)
for (i = 0; ports[i]; i++) {
struct port *port = GET_IN_PORT(this, i);
if (jack_connect(client, jack_port_name(port->jack_port), ports[i])) {
spa_log_warn(this->log, NAME" %p: Failed to connect %s to %s",
spa_log_warn(this->log, "%p: Failed to connect %s to %s",
this, jack_port_name(port->jack_port), ports[i]);
}
}
@ -591,7 +593,7 @@ impl_node_port_enum_params(void *object, int seq,
static int clear_buffers(struct impl *this, struct port *port)
{
if (port->n_buffers > 0) {
spa_log_debug(this->log, NAME " %p: clear buffers", this);
spa_log_debug(this->log, "%p: clear buffers", this);
port->n_buffers = 0;
this->started = false;
}
@ -739,7 +741,7 @@ static int impl_node_process(void *object)
uint32_t i;
int res = 0;
spa_log_trace(this->log, NAME" %p: process %d", this, this->n_in_ports);
spa_log_trace(this->log, "%p: process %d", this, this->n_in_ports);
for (i = 0; i < this->n_in_ports; i++) {
struct port *port = GET_IN_PORT(this, i);
@ -758,7 +760,7 @@ static int impl_node_process(void *object)
continue;
}
spa_log_trace(this->log, NAME" %p: port %d: buffer %d", this, i, io->buffer_id);
spa_log_trace(this->log, "%p: port %d: buffer %d", this, i, io->buffer_id);
b = &port->buffers[io->buffer_id];
src = &b->outbuf->datas[0];
@ -840,7 +842,7 @@ impl_init(const struct spa_handle_factory *factory,
sscanf(str, "pointer:%p", &this->client);
if (this->client == NULL) {
spa_log_error(this->log, NAME" %p: missing "SPA_KEY_API_JACK_CLIENT
spa_log_error(this->log, "%p: missing "SPA_KEY_API_JACK_CLIENT
" property", this);
return -EINVAL;
}