Skip to content

Logging

Shahriar Shahrabi edited this page May 12, 2020 · 2 revisions

Log

The Log class is responsible for printing out information for debugging purposes to both the console and the Log files, which are saved next to the executable. There are two different loggers the Engine Logger and the Client logger. The use the Log system, include it in your cpp file. The interaction with the loggers happens overs a series of macros. The reason for this is so that they can be turned of through the Debug, Release, Shipping Defines when they are not needed.

The Logger needs to be initialized before being used. However this is taken care of by the engine during the construction of the ToyRendererApp.

An example of printing with the logger is:

ENGINE_LOG_WARN("Component {} attempted to access the Transform of the Gameobject {},
 however the gameobject has no Transform attached", "AudioPlayer", gameobject.name);

On the game side, you should use the CLIENT_LOG_WARN instead for clarity. There are 6 different macros for different purposes theses are:

  1. Trace
  2. Debug
  3. Info
  4. Warn
  5. Error
  6. Fatal
Clone this wiki locally