void debuglog(char * text)
{
do{
int loglen = 0;
char *msgBuffer;
int hlogfile=MoreFileOpen("alex.log", MFS_MODE_CREATE|MFS_MODE_WRITE);
msgBuffer=vm_malloc(1024);
if(NULL==msgBuffer){MoreFileClose(hlogfile);break;}
memset(msgBuffer, 0, 1024);
if (hlogfile)
{
MoreFileSeek(hlogfile, 0, MFS_END);
loglen=sprintf(msgBuffer, text);
MoreFileWrite(hlogfile, msgBuffer, loglen);
MoreFileWrite(hlogfile, "\r\n", 2);
MoreFileClose(hlogfile);
vm_free(msgBuffer);
}
}while(0);
}
{
do{
int loglen = 0;
char *msgBuffer;
int hlogfile=MoreFileOpen("alex.log", MFS_MODE_CREATE|MFS_MODE_WRITE);
msgBuffer=vm_malloc(1024);
if(NULL==msgBuffer){MoreFileClose(hlogfile);break;}
memset(msgBuffer, 0, 1024);
if (hlogfile)
{
MoreFileSeek(hlogfile, 0, MFS_END);
loglen=sprintf(msgBuffer, text);
MoreFileWrite(hlogfile, msgBuffer, loglen);
MoreFileWrite(hlogfile, "\r\n", 2);
MoreFileClose(hlogfile);
vm_free(msgBuffer);
}
}while(0);
}