debug icon indicating copy to clipboard operation
debug copied to clipboard

Adding support for colors in ReactNative

Open jrobber opened this issue 5 years ago • 2 comments

ReactNative renders in a document-less mode, but goes through the browser for their live builds. Fortunately they tag the navigator as ReactNative making this easy to check for.

jrobber avatar Nov 01 '19 04:11 jrobber

Coverage Status

Coverage remained the same at 87.692% when pulling 18cfc3c2a6ea0e6d6151978c720c5268461ae81f on jrobber:master into 5c7c61dc0df0db4eb5de25707d8cd1b9be1add4f on visionmedia:master.

coveralls avatar Nov 01 '19 04:11 coveralls

With this change you can set the environment variables before you import debug anywhere (like in index.js or in a config.js) like so :

process.env.DEBUG = ['*'].join(','); //init,search,addListing:price,reservation:*
process.env.DEBUG_COLORS = true;

You could tie those to variables in the manifest if you want to, but the main value of this in ReactNative is development debugging, not distributed.

This will only allow the logs to be colored in the browser terminal. React-native/expo need to make changes that convert browser colors to server colors if debug is going to work in their terminals.

jrobber avatar Nov 01 '19 04:11 jrobber