This is more widely available than stdout, which can interfere with
other things.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
const struct prop_hdr *p;
for (i = 0; i < indent; i++)
const struct prop_hdr *p;
for (i = 0; i < indent; i++)
- printf(" ");
- printf("%p len=%zu", t, t->bytelen);
+ fprintf(stderr, " ");
+ fprintf(stderr, "%p len=%zu", t, t->bytelen);
for (p = t->prop; p; p = p->next) {
struct children *c;
struct name *n;
struct notifier *no;
if (is_literal(p)) {
for (p = t->prop; p; p = p->next) {
struct children *c;
struct name *n;
struct notifier *no;
if (is_literal(p)) {
- printf(" \"%s\"", (const char *)p);
+ fprintf(stderr, " \"%s\"", (const char *)p);
break;
}
switch (p->type) {
case CHILDREN:
c = (struct children *)p;
break;
}
switch (p->type) {
case CHILDREN:
c = (struct children *)p;
- printf(" CHILDREN(%p):parent=%p,children={%p,%p}\n",
+ fprintf(stderr, " CHILDREN(%p):parent=%p,children={%p,%p}\n",
p, c->parent,
c->children.n.prev, c->children.n.next);
break;
case NAME:
n = (struct name *)p;
p, c->parent,
c->children.n.prev, c->children.n.next);
break;
case NAME:
n = (struct name *)p;
- printf(" NAME(%p):%s", p, n->name);
+ fprintf(stderr, " NAME(%p):%s", p, n->name);
break;
case NOTIFIER:
no = (struct notifier *)p;
break;
case NOTIFIER:
no = (struct notifier *)p;
- printf(" NOTIFIER(%p):fn=%p", p, no->u.notifyfn);
+ fprintf(stderr, " NOTIFIER(%p):fn=%p", p, no->u.notifyfn);
- printf(" **UNKNOWN(%p):%i**", p, p->type);
+ fprintf(stderr, " **UNKNOWN(%p):%i**", p, p->type);
}
static void tal_dump_(unsigned int level, const struct tal_hdr *t)
}
static void tal_dump_(unsigned int level, const struct tal_hdr *t)
#ifdef CCAN_TAL_DEBUG
/**
#ifdef CCAN_TAL_DEBUG
/**
- * tal_dump - dump entire tal tree.
+ * tal_dump - dump entire tal tree to stderr.
*
* This is a helper for debugging tal itself, which dumps all the tal internal
* state.
*
* This is a helper for debugging tal itself, which dumps all the tal internal
* state.