1.1 --- a/src/test/SDL_test_log.c Sat Dec 15 00:30:17 2012 +0000
1.2 +++ b/src/test/SDL_test_log.c Fri Dec 14 23:05:34 2012 -0800
1.3 @@ -37,12 +37,6 @@
1.4
1.5 #include "SDL_test.h"
1.6
1.7 -/*
1.8 - * Note: Maximum size of SDLTest log message is less than SDLs limit
1.9 - * to ensure we can fit additional information such as the timestamp.
1.10 - */
1.11 -#define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584
1.12 -
1.13 /*!
1.14 * Converts unix timestamp to its ascii representation in localtime
1.15 *
1.16 @@ -52,18 +46,18 @@
1.17 *
1.18 * \param timestamp A Timestamp, i.e. time(0)
1.19 *
1.20 - * \return Ascii representation of the timestamp in localtime
1.21 + * \return Ascii representation of the timestamp in localtime in the format '08/23/01 14:55:02'
1.22 */
1.23 char *SDLTest_TimestampToString(const time_t timestamp)
1.24 {
1.25 time_t copy;
1.26 - static char buffer[256];
1.27 + static char buffer[64];
1.28 struct tm *local;
1.29
1.30 memset(buffer, 0, sizeof(buffer));\
1.31 copy = timestamp;
1.32 local = localtime(©);
1.33 - strftime(buffer, sizeof(buffer), "%a %Y-%m-%d %H:%M:%S %Z", local);
1.34 + strftime(buffer, sizeof(buffer), "%x %X", local);
1.35
1.36 return buffer;
1.37 }
1.38 @@ -83,7 +77,7 @@
1.39 va_end(list);
1.40
1.41 // Log with timestamp and newline
1.42 - SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_INFO, "%s: %s\n", SDLTest_TimestampToString(time(0)), logMessage);
1.43 + SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_INFO, " %s: %s", SDLTest_TimestampToString(time(0)), logMessage);
1.44 }
1.45
1.46 /*
1.47 @@ -101,5 +95,5 @@
1.48 va_end(list);
1.49
1.50 // Log with timestamp and newline
1.51 - SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_ERROR, "%s: %s\n", SDLTest_TimestampToString(time(0)), logMessage);
1.52 + SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_ERROR, "%s: %s", SDLTest_TimestampToString(time(0)), logMessage);
1.53 }