Logger utility
Search JS SDK for React offers a logging utility that you can use during development. You can monitor data requests and responses, and also watch values while debugging in development.
Typical scenarios also include using the utility to confirm your components are making the desired requests or dispatching the desired payloads when tracking visitor interactions.
Logger level values
The logging utility in the JS SDK is flexible and you can customize its use. You can choose what you would like to log and appear in your browser console. The following are acceptable Logger level values:
-
Logger.NONE- prints nothing. -
Logger.ERROR- prints errors only. -
Logger.WARN- prints errors and warnings. -
Logger.INFO- prints errors, warnings, and information. -
Logger.DEBUG- prints errors, warnings, and information. Also available for debugging. -
Logger.TRACE- prints everything and is available for debugging.
To prevent tracing in production, set the Logger level to Logger.NONE.