Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 23 Debugging and Profiling Your Game > Building an Error Logging System

BUILDING AN ERROR LOGGING SYSTEM

Every game needs to have a robust logging system. You can only go so far with the assert() macro from the standard C libraries. With the sheer size of games, you need the ability to define different levels of errors. Some errors are more important than others, and you want the ability to define different severities for them. You also need a way to disable certain errors altogether. Finally, these errors should be ignored in the release version of the game.

Logging informational messages is another thing we’ll need. This is how we’ll pepper the code to find out what’s happening inside a particular system. This logging will be based on tags; you can turn certain tags on or off, which enables or disables logs for that tag. For example, the event system may have its own tag. Enabling this tag will allow you to see what’s happening inside the event system as it updates without having to step through breakpoints.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial