> I would rather like the output to be sent to stderr / stdout and to a
I agree that this might be the most sophisticated solution, but I am
focusing on improving the game, and the proposed solution will actually not
have any negative impact on the actual game, and it solves the problem to
get feedback from people who are using a launcher.
> Nothing more than just a simple function that outputs both to a
> file and to stderr or stdout.
Of course it's simple, but you still would have to replace about 173
printfs (a quick, unsophisticated grep, ignoring snprintf).
I added a command line option to select where to put the log output
(--log=terminal / --log=file). This way a launcher can select the output
to go into a file. I would say that most (all?) people use only one
kind of output anyway, either terminal (when using the command line), or
the files (when using a launcher). No need to support both at the same time
(but as I have said: it would of course be the most sophisticated and flexible
solution, if some one supplies a patch :) ).
> On the other side, I won't be working on it for the foreseeable future.
Neither will I :) Sorry, I want to focus on getting the actual game better,
and if we have a patch that solves exactly the problem we needed to be solved,
I am not going to wait for 'the ultimate' solution, which allows us to send log
files to a certain IP address, supports sys.log, and is able to use the speakers
to read the messages out loud (though that would be a cool feature:) )
(obviously the last sentence should have many :) ).
I just committed a slighty modified version of the patch. As already mentioned
I added command line options --log=file / --log=terminal, so that the behaviour
can be changed without modifying the config file.
I tried adding some error checking as well (e.g. the log file might not be
readable). While it worked as expected for stdout, I get no error message
when stderr (i.e. stderr.log) can't be opened for writing (I made the write
non-writeable). Does anyone have an idea what might be causing this?
I took all feedback from Robert into account as well, and replaced the ugly #ifdef DIR_SEPARATOR with a static const.