Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- writeInLog(const destinationFile[], stringToWrite[])
- {
- new
- logFile[32] = "logs/";
- strcat(logFile, destinationFile);
- if(!fexist(logFile))
- {
- new
- File:fileToCreate = fopen(logFile, io_write);
- fclose(fileToCreate);
- }
- new
- logYear,
- logMonth,
- logDay,
- logHour,
- logMinute,
- logSecond,
- stringForLogging[256];
- getdate(logYear, logMonth, logDay);
- gettime(logHour, logMinute, logSecond);
- format(stringForLogging, 300, "<div id=\"sex\">[%d/%d/%d - %02d:%02d:%d] %s</div>\r\n", logDay, logMonth, logYear, logHour, logMinute, logSecond, stringToWrite);
- new
- File:fileToAppend = fopen(logFile, io_append);
- fwrite(fileToAppend, stringForLogging);
- fclose(fileToAppend);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment