diff options
Diffstat (limited to 'xorg-server/os/log.c')
-rw-r--r-- | xorg-server/os/log.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index e3a184721..02267638f 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -193,7 +193,7 @@ LogInit(const char *fname, const char *backup) sprintf(oldLog, "%s%s", logFileName, suffix);
free(suffix);
if (rename(logFileName, oldLog) == -1) {
- FatalError("Cannot move old log file (\"%s\" to \"%s\"\n",
+ FatalError("Cannot move old log file \"%s\" to \"%s\"\n",
logFileName, oldLog);
}
free(oldLog);
@@ -264,6 +264,14 @@ LogVWrite(int verb, const char *f, va_list args) {
char tmpBuffer[1024];
int len = 0;
+ static Bool newline = TRUE;
+
+ if (newline) {
+ sprintf(tmpBuffer, "[%10.3f] ", GetTimeInMillis() / 1000.0);
+ len = strlen(tmpBuffer);
+ if (logFile)
+ fwrite(tmpBuffer, len, 1, logFile);
+ }
/*
* Since a va_list can only be processed once, write the string to a
@@ -275,6 +283,7 @@ LogVWrite(int verb, const char *f, va_list args) tmpBuffer[sizeof(tmpBuffer)-1]=0;
len = strlen(tmpBuffer);
}
+ newline = (tmpBuffer[len-1] == '\n');
if ((verb < 0 || logVerbosity >= verb) && len > 0)
fwrite(tmpBuffer, len, 1, stderr);
if ((verb < 0 || logFileVerbosity >= verb) && len > 0) {
|