Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

creating a logfile

This topic is 5973 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, I''m trying to create a logfile in my game by simply using fprintf and outputing strings to a file. The main reason i''m doing this is to debug some parts of my network code to make sure that what i want to be sent is being sent. The problem I have is that if the program exits because of an error the logfile is left blank. It works fine when the program exits normally. Any help would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
If it''s completely blank, you''re probably not even calling fclose(). Everything will be flushed when you close the file. However, as was already suggested, you should also use fflush() occasionally in case you''re program crashes (in which case fclose() is definitely never called, and you''re logfile is blank).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!