Logging
If you have already covered a few of the chapters in this book, you can appreciate how valuable logging is to making sure your game works as expected. In Unity, all log messages are output to the Console unless you create a custom logger that writes to a file or service. We will create a custom logger later in this section. For now though, let's look at the logging options Unity provides us with out of the box, as listed:
print
: This is the shorthand equivalent toDebug.log
.Debug.Log
,Debug.LogFormat
: This outputs the standard information message in unformatted or formatted text. Messages appear with info icon in the Console window.Debug.LogError
,Debug.LogErrorFormat
: This outputs unformatted and formatted error messages. Messages appear with an error icon in the Console window.Debug.LogException
: This outputs the exception to the console with an error icon.Debug.LogWarning, Debug.LogWarningFormat
: This outputs unformatted and formatted warning messages. Messages appear with a warning...