diff options
author | marha <marha@users.sourceforge.net> | 2010-01-31 18:54:23 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-01-31 18:54:23 +0000 |
commit | 62d24022ec725850c6635118b5cd372ae47d63d9 (patch) | |
tree | 1393d83c103303ade89e34444c1bf4fdf81b7d5f /xorg-server/os | |
parent | fe6927d79e02d01cce20ecf56c8721fcadc2d278 (diff) | |
parent | 007385f704a99ab49dab0789f9c330a1a3a455be (diff) | |
download | vcxsrv-62d24022ec725850c6635118b5cd372ae47d63d9.tar.gz vcxsrv-62d24022ec725850c6635118b5cd372ae47d63d9.tar.bz2 vcxsrv-62d24022ec725850c6635118b5cd372ae47d63d9.zip |
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/os')
-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) {
|