Check out example codes for "Disable Debug.log Unity". It will help you in understanding the concepts better.
Code Example 1
#if UNITY_EDITOR
Debug.logger.logEnabled = true;
#else
Debug.logger.logEnabled = false;
#endif
Learn ReactJs, React Native from akashmittal.com