Hi, I want to creat a record of user journey thought the game I'm coding, that would record a script of the user inputs to a separate log file, I am thinking of creating a userrecord class and the user input will be stored into a text file using filewriter class from java.io.package. Not sure if I write into the file with evey input or store the input into a stack and write at the end of the game. The former avoids the possibity of something goes wrong in the middle of the game, the later insures that problems of file changing directory or other errors (read many problems arise this way) Tom happening. Is there a good practice on doing this?
Jump to Post
A log file is incredibly useful when things go wrong, provided it has been written to disk. So for me, waiting until the end to write it is not a good idea because a crash may prevent it being written. I would write all the records ditrectly to the file …
All 2 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.