Skip to contentSkip to conversation

how does udhcpc print messages to console

Buildroot Jürgen Benjamin Ronshausen 1 participant 1 message Nov 6, 2012

lore
Share & tools
lore
#0 lore raw

hi,

i am trying to print message from my program which is called in a shell script.

problem is the shell script collects all the output from my program and doesn't print it immediately.

i noticed, that udhcpc print its messages immediately by calling syslog.

from debug.h

# define LOG_EMERG	"EMERGENCY!"
# define LOG_ALERT	"ALERT!"
# define LOG_CRIT	"critical!"
# define LOG_WARNING	"warning"
# define LOG_ERR	"error"
# define LOG_INFO	"info"
# define LOG_DEBUG	"debug"
# define LOG(level, str, args...) do { printf("%s, ", level); \
				printf(str, ## args); \
				printf("\n"); } while(0)
# define OPEN_LOG(name) do {;} while(0)
#define CLOSE_LOG() do {;} while(0)

from dhcpc.c

OPEN_LOG("udhcpc");
LOG(LOG_INFO, "udhcp client (v%s) started", VERSION);

is there more than this to do?

thx J?rgen