Skip to main content

📖 Console logs

The Gleap ReactNative SDK collects console logs for the Release profile by default. Please note that you must enable debug logs for iOS manually. Further more you can make use of our custom logs, which offer more control over the logs.

Default console logs

Console logs are enabled by default on Release profile builds. In debug mode, console logs are disabled by default.

Enable console logs in debug mode

You can enable console logs in debug mode for iOS by calling the following method. Android will include the logs by default. Please make sure to call this method BEFORE initializing the Gleap SDK.

Gleap.enableDebugConsoleLog();
info

Please note that this can lead to freezing or crashing applications, depending on what 3rd party libraries you have installed. If you encounter an app freeze with this option enabled, please disable it again or remove 3rd parties, that also rewire the console logs (like Firebase Crashlytics or Sentry).

Disable default console logs

It is possible to disable the default collection of console logs by calling the following method prior to the initialization of Gleap.

Gleap.disableConsoleLog();

Custom logs

Custom logs allow you to create logs in the Gleap activity log. There are three severnity types available for logs: ERROR, WARNING and INFO.

Gleap.log("This is a test custom log.");

By default logs will be created with the severnity INFO. Use the following method to explicitly set the severnity.

Gleap.logWithLogLevel("This is a test custom log WARNING.", "WARNING");