xserver-multidpi/os
Daniel Kurtz 6ce0eac4f8 os/log: only write timestamp if a message is actually written to logfile
The current code will write a timestamps into the logFile whenever
the last message ended with a '\n' - even if the verb for that timestamp
is at too high a level.  This timestamp will sit there with no matching
message until the next call to LogVWrite with a valid verb.

In other words, in some cases, timestamps in the X.org.log are for some
completely unrelated message that was previously ignored due to
insufficient verbosity, and not for the message that appears next to it
in the log file.

We keep the current policy which appears to be to only apply timestamps if
a message is actually written to a log file.  That is, no timestamps on
stderr, or in the mem buffer.  Therefore, the timestamp stringification
is moved to the conditional where it is used.

Since logging uses a fixed length buffer, this patch also forces a '\n'
whenever a buffer is terminated due to a too-long write request.  This
allows the newline detection to work even on overflow, and also cleans up
the log a bit in the overflow case.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-03 14:59:23 +10:00
..
.gitignore dix and os: gitignore dix.O and os.O 2011-09-23 17:14:47 -07:00
access.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
auth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
backtrace.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
client.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
connection.c os: Add -displayfd option 2012-05-01 11:36:30 +10:00
io.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
log.c os/log: only write timestamp if a message is actually written to logfile 2012-05-03 14:59:23 +10:00
Makefile.am Move to autoconf standard function name checks & defines 2011-12-05 14:32:45 -08:00
mitauth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
oscolor.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
osdep.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
osinit.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
rpcauth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strcasecmp.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strcasestr.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strlcat.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strlcpy.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strndup.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
utils.c os: Add -displayfd option 2012-05-01 11:36:30 +10:00
WaitFor.c os: make timers signal-safe 2012-05-01 11:36:35 +10:00
xdmauth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xdmcp.c Change lastDeviceIdleTime to be per-device 2012-03-22 13:12:56 +10:00
xprintf.c os/xprintf: add Xvscnprintf and Xscnprintf 2012-05-03 14:59:23 +10:00
xsha1.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xstrans.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00