log: remove NAME as log prefix, topic is enough

This commit is contained in:
Wim Taymans 2021-10-03 12:03:45 +02:00
parent f275e3baaa
commit a95937dfdb
2 changed files with 18 additions and 19 deletions

View file

@ -42,8 +42,6 @@
#include "modules/spa/spa-node.h" #include "modules/spa/spa-node.h"
#include "client-node.h" #include "client-node.h"
#define NAME "client-node"
PW_LOG_TOPIC_EXTERN(mod_topic); PW_LOG_TOPIC_EXTERN(mod_topic);
#define PW_LOG_TOPIC_DEFAULT mod_topic #define PW_LOG_TOPIC_DEFAULT mod_topic
@ -282,7 +280,7 @@ static int clear_buffers(struct node *this, struct mix *mix)
for (i = 0; i < mix->n_buffers; i++) { for (i = 0; i < mix->n_buffers; i++) {
struct buffer *b = &mix->buffers[i]; struct buffer *b = &mix->buffers[i];
spa_log_debug(this->log, NAME" %p: clear buffer %d", this, i); spa_log_debug(this->log, "%p: clear buffer %d", this, i);
for (j = 0; j < b->buffer.n_datas; j++) { for (j = 0; j < b->buffer.n_datas; j++) {
struct spa_data *d = &b->datas[j]; struct spa_data *d = &b->datas[j];
@ -491,7 +489,7 @@ do_update_port(struct node *this,
uint32_t i; uint32_t i;
if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_PARAMS) { if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_PARAMS) {
spa_log_debug(this->log, NAME" %p: port %u update %d params", this, port->id, n_params); spa_log_debug(this->log, "%p: port %u update %d params", this, port->id, n_params);
for (i = 0; i < port->n_params; i++) for (i = 0; i < port->n_params; i++)
free(port->params[i]); free(port->params[i]);
port->n_params = n_params; port->n_params = n_params;
@ -526,7 +524,7 @@ clear_port(struct node *this, struct port *port)
{ {
struct mix *mix; struct mix *mix;
spa_log_debug(this->log, NAME" %p: clear port %p", this, port); spa_log_debug(this->log, "%p: clear port %p", this, port);
do_update_port(this, port, do_update_port(this, port,
PW_CLIENT_NODE_PORT_UPDATE_PARAMS | PW_CLIENT_NODE_PORT_UPDATE_PARAMS |
@ -757,7 +755,7 @@ do_port_use_buffers(struct impl *impl,
p = GET_PORT(this, direction, port_id); p = GET_PORT(this, direction, port_id);
spa_log_debug(this->log, NAME " %p: %s port %d.%d use buffers %p %u flags:%08x", this, spa_log_debug(this->log, "%p: %s port %d.%d use buffers %p %u flags:%08x", this,
direction == SPA_DIRECTION_INPUT ? "input" : "output", direction == SPA_DIRECTION_INPUT ? "input" : "output",
port_id, mix_id, buffers, n_buffers, flags); port_id, mix_id, buffers, n_buffers, flags);
@ -826,7 +824,7 @@ do_port_use_buffers(struct impl *impl,
mb[i].mem_id = m->id; mb[i].mem_id = m->id;
mb[i].offset = SPA_PTRDIFF(baseptr, mem->map->ptr); mb[i].offset = SPA_PTRDIFF(baseptr, mem->map->ptr);
mb[i].size = SPA_PTRDIFF(endptr, baseptr); mb[i].size = SPA_PTRDIFF(endptr, baseptr);
spa_log_debug(this->log, NAME" %p: buffer %d %d %d %d", this, i, mb[i].mem_id, spa_log_debug(this->log, "%p: buffer %d %d %d %d", this, i, mb[i].mem_id,
mb[i].offset, mb[i].size); mb[i].offset, mb[i].size);
b->buffer.n_metas = SPA_MIN(buffers[i]->n_metas, MAX_METAS); b->buffer.n_metas = SPA_MIN(buffers[i]->n_metas, MAX_METAS);
@ -934,7 +932,7 @@ static int impl_node_process(void *object)
n->rt.activation->signal_time = SPA_TIMESPEC_TO_NSEC(&ts); n->rt.activation->signal_time = SPA_TIMESPEC_TO_NSEC(&ts);
if (SPA_UNLIKELY(spa_system_eventfd_write(this->data_system, this->writefd, 1) < 0)) if (SPA_UNLIKELY(spa_system_eventfd_write(this->data_system, this->writefd, 1) < 0))
spa_log_warn(this->log, NAME" %p: error %m", this); spa_log_warn(this->log, "%p: error %m", this);
return SPA_STATUS_OK; return SPA_STATUS_OK;
} }
@ -1000,7 +998,7 @@ client_node_port_update(void *data,
struct port *port; struct port *port;
bool remove; bool remove;
spa_log_debug(this->log, NAME" %p: got port update change:%08x params:%d", spa_log_debug(this->log, "%p: got port update change:%08x params:%d",
this, change_mask, n_params); this, change_mask, n_params);
if (!CHECK_PORT_ID(this, direction, port_id)) if (!CHECK_PORT_ID(this, direction, port_id))
return -EINVAL; return -EINVAL;
@ -1038,7 +1036,7 @@ static int client_node_set_active(void *data, bool active)
{ {
struct impl *impl = data; struct impl *impl = data;
struct node *this = &impl->node; struct node *this = &impl->node;
spa_log_debug(this->log, NAME" %p: active:%d", this, active); spa_log_debug(this->log, "%p: active:%d", this, active);
return pw_impl_node_set_active(impl->this.node, active); return pw_impl_node_set_active(impl->this.node, active);
} }
@ -1063,7 +1061,7 @@ static int client_node_port_buffers(void *data,
struct mix *mix; struct mix *mix;
uint32_t i, j; uint32_t i, j;
spa_log_debug(this->log, NAME " %p: %s port %d.%d buffers %p %u", this, spa_log_debug(this->log, "%p: %s port %d.%d buffers %p %u", this,
direction == SPA_DIRECTION_INPUT ? "input" : "output", direction == SPA_DIRECTION_INPUT ? "input" : "output",
port_id, mix_id, buffers, n_buffers); port_id, mix_id, buffers, n_buffers);
@ -1128,7 +1126,7 @@ static void node_on_data_fd_events(struct spa_source *source)
struct node *this = source->data; struct node *this = source->data;
if (source->rmask & (SPA_IO_ERR | SPA_IO_HUP)) { if (source->rmask & (SPA_IO_ERR | SPA_IO_HUP)) {
spa_log_warn(this->log, NAME" %p: got error", this); spa_log_warn(this->log, "%p: got error", this);
return; return;
} }
@ -1143,7 +1141,7 @@ static void node_on_data_fd_events(struct spa_source *source)
pw_log_warn("(%s-%u) client missed %"PRIu64" wakeups", pw_log_warn("(%s-%u) client missed %"PRIu64" wakeups",
node->name, node->info.id, cmd - 1); node->name, node->info.id, cmd - 1);
spa_log_trace_fp(this->log, NAME" %p: got ready", this); spa_log_trace_fp(this->log, "%p: got ready", this);
spa_node_call_ready(&this->callbacks, SPA_STATUS_HAVE_DATA); spa_node_call_ready(&this->callbacks, SPA_STATUS_HAVE_DATA);
} }
} }

View file

@ -46,7 +46,8 @@
#include "client-node.h" #include "client-node.h"
#include "transport.h" #include "transport.h"
#define NAME "client-node0" PW_LOG_TOPIC_EXTERN(mod_topic);
#define PW_LOG_TOPIC_DEFAULT mod_topic
/** \cond */ /** \cond */
@ -301,7 +302,7 @@ static int impl_node_enum_params(void *object, int seq,
if (spa_pod_filter(&b, &result.param, param, filter) != 0) if (spa_pod_filter(&b, &result.param, param, filter) != 0)
continue; continue;
pw_log_debug(NAME " %p: %d param %u", this, seq, result.index); pw_log_debug("%p: %d param %u", this, seq, result.index);
spa_node_emit_result(&this->hooks, seq, 0, SPA_RESULT_TYPE_NODE_PARAMS, &result); spa_node_emit_result(&this->hooks, seq, 0, SPA_RESULT_TYPE_NODE_PARAMS, &result);
if (++count == num) if (++count == num)
@ -359,7 +360,7 @@ static int send_clock_update(struct node *this)
clock_gettime(CLOCK_MONOTONIC, &ts); clock_gettime(CLOCK_MONOTONIC, &ts);
now = SPA_TIMESPEC_TO_NSEC(&ts); now = SPA_TIMESPEC_TO_NSEC(&ts);
pw_log_trace(NAME " %p: now %"PRIi64, this, now); pw_log_trace("%p: now %"PRIi64, this, now);
struct spa_command_node0_clock_update cu = struct spa_command_node0_clock_update cu =
SPA_COMMAND_NODE0_CLOCK_UPDATE_INIT(type, SPA_COMMAND_NODE0_CLOCK_UPDATE_INIT(type,
@ -419,7 +420,7 @@ impl_node_sync(void *object, int seq)
spa_return_val_if_fail(this != NULL, -EINVAL); spa_return_val_if_fail(this != NULL, -EINVAL);
pw_log_debug(NAME " %p: sync %p", this, this->resource); pw_log_debug("%p: sync %p", this, this->resource);
if (this->resource == NULL) if (this->resource == NULL)
return -EIO; return -EIO;
@ -578,7 +579,7 @@ impl_node_port_enum_params(void *object, int seq,
port = GET_PORT(this, direction, port_id); port = GET_PORT(this, direction, port_id);
pw_log_debug(NAME " %p: %d port %d.%d %u %u %u", this, seq, pw_log_debug("%p: %d port %d.%d %u %u %u", this, seq,
direction, port_id, id, start, num); direction, port_id, id, start, num);
result.id = id; result.id = id;
@ -605,7 +606,7 @@ impl_node_port_enum_params(void *object, int seq,
if (spa_pod_filter(&b, &result.param, param, filter) < 0) if (spa_pod_filter(&b, &result.param, param, filter) < 0)
continue; continue;
pw_log_debug(NAME " %p: %d param %u", this, seq, result.index); pw_log_debug("%p: %d param %u", this, seq, result.index);
spa_node_emit_result(&this->hooks, seq, 0, SPA_RESULT_TYPE_NODE_PARAMS, &result); spa_node_emit_result(&this->hooks, seq, 0, SPA_RESULT_TYPE_NODE_PARAMS, &result);
if (++count == num) if (++count == num)