SDL  2.0
SDL_test_log.c File Reference
#include "SDL_config.h"
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "SDL.h"
#include "SDL_test.h"
+ Include dependency graph for SDL_test_log.c:

Go to the source code of this file.

Functions

static char * SDLTest_TimestampToString (const time_t timestamp)
void SDLTest_Log (SDL_PRINTF_FORMAT_STRING const char *fmt,...)
 Prints given message with a timestamp in the TEST category and INFO priority.
void SDLTest_LogError (SDL_PRINTF_FORMAT_STRING const char *fmt,...)
 Prints given message with a timestamp in the TEST category and the ERROR priority.

Function Documentation

void SDLTest_LogError ( SDL_PRINTF_FORMAT_STRING const char *  fmt,
  ... 
)
static char* SDLTest_TimestampToString ( const time_t  timestamp)
static

Definition at line 68 of file SDL_test_log.c.

References SDL_memset.

Referenced by SDLTest_Log(), and SDLTest_LogError().

{
time_t copy;
static char buffer[64];
struct tm *local;
SDL_memset(buffer, 0, sizeof(buffer));
copy = timestamp;
local = localtime(&copy);
strftime(buffer, sizeof(buffer), "%x %X", local);
return buffer;
}