05.08.2011, 21:22
Open, write, close, open, write, close, again and again and again everytime anyone writes in the chat/does a command/buys something or what so ever - that's super slow and will probably decrease the server performence if many players are logged in. The print and printf natives are probably faster but it is impossible to log an entire server into one file. So what are the solutions? Is it better to fopen() a file, log whatever you want and fclose() it when the server shuts down? Also, I don't think at all that it is worthy to consume TONS of memory on strings and just write the strings to files when the server shuts down.
I'll be glad to hear your opinions on what is the most efficient way to make a log system- especially if you want separate logs for each and every player.
I'll be glad to hear your opinions on what is the most efficient way to make a log system- especially if you want separate logs for each and every player.