Fatal Log Settings

When logging a fatal error, it is often necessary to stop the application in order to prevent any further damage. The Fatal method of the Log class provides an option to quit the application when the fatal error is logged. If the quit parameter is set to true (the default), the Application.Quit() method is called, which immediately stops the application.

However, there may be instances when you want to prevent the application from quitting. In such cases, you can set the quit parameter to false, as demonstrated in the above example. This way, the logging will still indicate that a fatal error has occurred, but the application will not be terminated.

Note that logging a fatal error should be used with caution, as it indicates a severe issue in the application that needs to be addressed. The Fatal method should not be used for logging non-critical issues or for debugging purposes.

Here is an example of how you log fatal messages without quitting the application:

using UnityEngine;
using CatLog;

public class FatalExample : MonoBehaviour
{
    private void Start()
    {
        Log.Fatal("This is a fatal error!", false);
    }
}

Last updated