hi there this is my first ever time posting here, so ive a lot to learn. I wanted to share some code for logging. This is code that ive used in the past to log from some of my Pc applications that
ive written over the years and Quake2 mods that i worked on. I added it to my XBOX360 menu it builds fine but for some reason i do not get any file written to the drive. Im new to Xbox360
Dev. But wanted to share my code anyone incase it would be helpful to someone. cheers regards Richard quadrant2005
owe i see you use the code thingy to imbedd the code into the forum post :) at least i got that bit right,
ive written over the years and Quake2 mods that i worked on. I added it to my XBOX360 menu it builds fine but for some reason i do not get any file written to the drive. Im new to Xbox360
Dev. But wanted to share my code anyone incase it would be helpful to someone. cheers regards Richard quadrant2005
Code:
#include <time.h>
static const char * f_szLogFile = "HDD:\\quadkill.log";
void Log_Printf(const char * format,...)
{
time_t now;
char timestring[64];
va_list marker;
FILE * fp = 0;
va_start(marker, format);
fp = fopen(f_szLogFile , "a+");
if (!fp)
return;
time(&now);
fprintf(fp, timestring);
vfprintf(fp, format, marker);
fclose(fp);
}
owe i see you use the code thingy to imbedd the code into the forum post :) at least i got that bit right,
Code:
; to use the above code here are examples of calling it
Log_PrintQ ("Name %s : Max Armour %s\n",PLAYER::GET_PLAYER_NAME(i),PLAYER::GET_PLAYER_MAX_ARMOUR(i));
Log_PrintQ ("hello this is a test\n");