No reason to not unify the prints whenever possible.
However, the process stdout and stderr prints are special. They do not
come from rrdd, but from the process that was execv'd by rrdd. That
why they should begin with the name of the binary. Those prints should
be printed to stderr too to unify the debug output.
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
error = select(maxfd, &rfds, NULL, NULL, NULL);
if (error < 0) {
- printf("Error with select: %m\n");
+ pr_err("Error with select: %m\n");
break;
}
while(bytes--) {
if (*eptr == '\n') {
*eptr = 0;
- printf("%s[%5d %s] %s: %s%s\n", indent,
+ fprintf(stderr, "%s[%5d %s] %s: %s%s\n", indent,
child, cmd, typestr, sptr, normal_color);
sptr = eptr;
}