Console.log for Release build?


I am using Cocos Creator 3.4.2
For Android debug build console.log is working fine.
In Release build its not working as expected but what is the way to print logs in release mode?
Needed for some test cases.


I tested that it can print normally;

@Koei Thanks for the reply.
I already figure that out.
console.log() will work for both debug & release
cc.log() will only work in debug selected from build menu.

Is there any macro to detect debug is ON or not?

You can use window._CCSettings.debug to get it, and if window._CCSettings = undefined, you can create a global object to save it.

Yes, its undefined.

So for that i need to manually make it on/off everytime, right?

window._CCSettings is assigned by reading the setting.json file

This is not working neither for Android nor Mac simulator.
_CCSettings showing error

window._CCSettings will be cleared.You can’t get it even with global variables?

May i know how?
This is not working
globalThis.nativeDebug = window._CCSettings.debug;