Check out example codes for "Code to disable Debug.log". 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