> For the complete documentation index, see [llms.txt](https://kdoore.gitbook.io/cs2335/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kdoore.gitbook.io/cs2335/optional-supplemental-content/optional-content/disable-debug-logging.md).

# Disable Debug Logging

[Unity Reference ](https://docs.unity3d.com/ScriptReference/Logger-logEnabled.html)

Adding the following 2 lines of code to any script will suppress Debug.Log output to the console. Include this code in your files, and keep as a comment while designing your game so you'll get your debug info. Then activate by uncommenting the code: `logger.logEnabled = Debug.isDebugBuild;` Below the code is active, so the debug message will not show in the console unless running in debug mode.

```java
    /// allows for debugging to be disabled for a script
    private static ILogger logger = Debug.unityLogger;

    void Start () {
        logger.logEnabled = Debug.isDebugBuild;

        Debug.Log("Test Debug Logging");
    }
```
