My colleagues say that remaining Debug.Log
causes latency.
But I think it is useful for enhancing and accelerating our development.
Furthermore, I found there is an option that disables Debug.Log
on the production environment.
Give me your opinions.
When a Debug.Log()
is called, it can affect performance because it will do some stack trace parsing and then write some stuff to a file.
It has to dig right down into the stack trace so if you have a lot of Debug.Log
s then you might see a performance hit in your build.
You might want to circumvent this by only calling your Debug.Log
statements when in Debug Build. From the Unity Docs:
In the Build Settings dialog there is a check box called "Development Build".
So you could do something like this that will only be called if the box is checked:
if (Debug.isDebugBuild) {
Debug.Log ("If you can see this, you are in Debug Mode");
}
An easier alternative is to go to Player Settings and un-check "Use Player Log":
This will stop Log files being written.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With