Closed uniflare closed 2 years ago
This brings so many questions. What was my intention behind logging two years ago? What was intention of @xoorath for logging? Did I really ship the debug .dll with enabled logging to people?
Also for some reason only Linux build was complaining about the missing std vector include, Windows build was fine :D I will publish to Steam a bit later, perhaps someone at our Discord can test it on their Linux server.
Indeed :D. I don't see an issue with logging, it could prove useful to mission makers to see what happened or what commands are actually being actioned.
I don't think you shipped the debug DLL, I think some logging was enabled even in release from what I remember.
Thanks for adding the vector, I did compile locally using WSL and GCC, probably a dirty workspace as I was managing 2 branches at the time so good catch :).
An no worries, it is something I ended up fixing on my end anyway for our server, as we like FileXT and want to continue using it. Cleaning it up a little and making it official wasn't a big deal.
Thanks for your time on this matter :).
The only intent I had for logging was make it a little less hairy, it used to be like so:
#define LOG(text) fprintf(gLogFile, text); fflush(gLogFile)
#define LOG_0(text) fprintf(gLogFile, text); fflush(gLogFile)
#define LOG_1(text, a) fprintf(gLogFile, text, a); fflush(gLogFile)
#define LOG_2(text, a, b) fprintf(gLogFile, text, a, b); fflush(gLogFile)
#define LOG_3(text, a, b, c) fprintf(gLogFile, text, a, b, c); fflush(gLogFile)
#define LOG_4(text, a, b, c, d) fprintf(gLogFile, text, a, b, c, d); fflush(gLogFile)
Except I made the mistake of thinking it would also be a direct improvement to have the log file default to stderr when the file pointer was unassigned.
Now I know better :)
This change refactors the logging mechanism such that: