11.04.2013, 21:59
Quote:
Creating a stock will require a timer.
Running the server under windows the timers will not be accurate as they will have some offset. Otherwise in Linux the timer will highly acurate because of the kernel! |
Anyways, you can make a stock, such as
Код:
Log(sz_fileName[], sz_input[]) { new sz_logEntry[156], i_dateTime[2][3], File: fileHandle = fopen(sz_fileName, io_append); gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]); getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]); format(sz_logEntry, sizeof(sz_logEntry), "[%i/%i/%i - %i:%i:%i] %s\r\n", i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], sz_input); fwrite(fileHandle, sz_logEntry); return fclose(fileHandle); }
Код:
new log[256]; format(log, sizeof(log), "Message here."); Log("logs/test.log", log);