summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--instance.c4
-rw-r--r--service.c12
-rw-r--r--ubus.c10
3 files changed, 13 insertions, 13 deletions
diff --git a/instance.c b/instance.c
index 112db6f..2a648d7 100644
--- a/instance.c
+++ b/instance.c
@@ -90,7 +90,7 @@ instance_start(struct service_instance *in)
return;
}
- DPRINTF("Started instance %s::%s\n", in->srv->name, in->name);
+ LOG("Started instance %s::%s\n", in->srv->name, in->name);
in->proc.pid = pid;
uloop_process_add(&in->proc);
}
@@ -112,7 +112,7 @@ instance_exit(struct uloop_process *p, int ret)
struct service_instance *in;
in = container_of(p, struct service_instance, proc);
- DPRINTF("Instance %s::%s exit with error code %d\n", in->srv->name, in->name, ret);
+ LOG("Instance %s::%s exit with error code %d\n", in->srv->name, in->name, ret);
uloop_timeout_cancel(&in->timeout);
if (in->restart)
instance_start(in);
diff --git a/service.c b/service.c
index 44b10be..16593fc 100644
--- a/service.c
+++ b/service.c
@@ -35,15 +35,15 @@ service_instance_update(struct vlist_tree *tree, struct vlist_node *node_new,
in_n = container_of(node_new, struct service_instance, node);
if (in_o && in_n) {
- DPRINTF("Update instance %s::%s\n", in_o->srv->name, in_o->name);
+ LOG("Update instance %s::%s\n", in_o->srv->name, in_o->name);
instance_update(in_o, in_n);
instance_free(in_n);
} else if (in_o) {
- DPRINTF("Free instance %s::%s\n", in_o->srv->name, in_o->name);
+ LOG("Free instance %s::%s\n", in_o->srv->name, in_o->name);
instance_stop(in_o, false);
instance_free(in_o);
} else if (in_n) {
- DPRINTF("Create instance %s::%s\n", in_n->srv->name, in_n->name);
+ LOG("Create instance %s::%s\n", in_n->srv->name, in_n->name);
instance_start(in_n);
}
}
@@ -148,11 +148,11 @@ service_handle_set(struct ubus_context *ctx, struct ubus_object *obj,
s = avl_find_element(&services, name, s, avl);
if (s) {
- DPRINTF("Update service %s\n", name);
+ LOG("Update service %s\n", name);
return service_update(s, msg, tb, add);
}
- DPRINTF("Create service %s\n", name);
+ LOG("Create service %s\n", name);
s = service_alloc(name);
if (!s)
return UBUS_STATUS_UNKNOWN_ERROR;
@@ -230,7 +230,7 @@ service_handle_delete(struct ubus_context *ctx, struct ubus_object *obj,
in = vlist_find(&s->instances, blobmsg_data(cur), in, node);
if (!in) {
- fprintf(stderr, "instance %s not found\n", (char *) blobmsg_data(cur));
+ ERROR("instance %s not found\n", (char *) blobmsg_data(cur));
return UBUS_STATUS_NOT_FOUND;
}
diff --git a/ubus.c b/ubus.c
index 8c51b53..7b96fd6 100644
--- a/ubus.c
+++ b/ubus.c
@@ -22,7 +22,7 @@ static void procd_restart_ubus(void)
char *argv[] = { "ubusd", NULL, ubus_socket, NULL };
if (ubus_proc.pending) {
- DPRINTF("Killing existing ubus instance, pid=%d\n", (int) ubus_proc.pid);
+ ERROR("Killing existing ubus instance, pid=%d\n", (int) ubus_proc.pid);
kill(ubus_proc.pid, SIGKILL);
uloop_process_delete(&ubus_proc);
}
@@ -38,11 +38,11 @@ static void procd_restart_ubus(void)
}
if (ubus_proc.pid <= 0) {
- DPRINTF("Failed to start new ubus instance\n");
+ ERROR("Failed to start new ubus instance\n");
return;
}
- DPRINTF("Launched new ubus instance, pid=%d\n", (int) ubus_proc.pid);
+ LOG("Launched new ubus instance, pid=%d\n", (int) ubus_proc.pid);
uloop_process_add(&ubus_proc);
}
@@ -55,7 +55,7 @@ static void procd_ubus_try_connect(void)
ctx = ubus_connect(ubus_socket);
if (!ctx) {
- DPRINTF("Connection to ubus failed\n");
+ DEBUG(2, "Connection to ubus failed\n");
return;
}
@@ -73,7 +73,7 @@ static void procd_ubus_connection_lost(struct ubus_context *old_ctx)
procd_ubus_try_connect();
}
- DPRINTF("Connected to ubus, id=%08x\n", ctx->local_id);
+ LOG("Connected to ubus, id=%08x\n", ctx->local_id);
ubus_add_uloop(ctx);
}