Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Log File code

Author
Message
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 3rd Feb 2004 15:39 Edited at: 5th Feb 2004 17:43
this little snippet allows you to keep a logfile for your games:



Its useful for big games, helping people who has problems, example:

write_to_log(5,"Setting Display Mode")
write_to_log(20,"Loading 3D objects")

The reason I made this, is because open to write only works if the file DOESNT exist. This makes a temporary file that gets deleted. Have fun!


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Feb 2004 11:49
what happens if the game crashes before you delete the temp file, and haven't closed the current file yet?

"eureka" - Archimedes
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 5th Feb 2004 17:40
Then a temp file will exist, I can modify the code to prevent this.. But when the file isnt closed isnt a real problem. I've had enough errors with this code (opened the file, then a syntax error, so the file was still opened)


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"

Login to post a reply

Server time is: 2024-04-27 22:27:56
Your offset time is: 2024-04-27 22:27:56