- Home /
How disable log console in release?
Hello, after build my project i see small console in game window (at one line). I dont have development build. The console appears at the top of the screen. Anyone know how to disable it?
I tried function in code:
Debug.ClearDeveloperConsole(); Debug.unityLogger.logEnabled = false; Debug.developerConsoleVisible = false;
console still visible... :(
Answer by sacredgeometry · Apr 10, 2020 at 01:28 PM
This is a duplicate post
https://answers.unity.com/questions/1301347/how-to-disable-all-logging-on-release-build.html
Answer by omar92 · Mar 18, 2021 at 04:34 PM
my solution (Tested on Unity2019.4)
this will only show exceptions
you can set it to LogType.Error for exceptions and errors and so on
#if !(DEVELOPMENT_BUILD || UNITY_EDITOR)
Debug.unityLogger.filterLogType = LogType.Exception;
#endif
or use
#if !(DEVELOPMENT_BUILD || UNITY_EDITOR)
Debug.unityLogger.logEnabled = false;
#endif
I wonder why copy&paste this code gives me "error CS1519: Invalid token '=' in class, struct, or interface member declaration" on builds.