[BusyBox] init: leading '\r' in log messages?

Paul Fox pgf at brightstareng.com
Thu Nov 11 19:09:48 UTC 2004


hi -- 

can anyone tell me why init adds a carriage return to the start
of all of its logged messages?  the code in message() looks
like:
    
	msg[0] = '\r';
		va_start(arguments, fmt);
	l = vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments) + 1;
		va_end(arguments);

i understand the aesthetics of having one's output start in
column 0, but this may cause a tty log or a screen capture to
lose information, if init's message comes out on top of a
partially completed line of text.  and in syslog output (or, at
least, in the output of logread) it just looks bad, since at some
point in the process it gets printified into "^M":

    Jan  1 00:00:26 mybox daemon.info init: ^MStarting pid 562, ...

my opinion is that the leading '\r' should go away completely.
if not, i think it should at least be removed from the syslog path.

(the only reason i can think of for leaving it is if it's necessary
to full some heuristic in syslog that's trying to decide what
sort of a message it's dealing with -- there's code there that
guesses at the precence of a timestamp, for instance.  but this
is conjecture.)

paul
=---------------------
 paul fox, pgf at brightstareng.com



More information about the busybox mailing list