Skip to main content
Version: 2.x.x

Log Level – React Native

Log levels control how much diagnostic information the SDK emits. They allow you to adjust logging verbosity based on your debugging needs without affecting SDK behavior.

Log levels are hierarchical — higher verbosity levels automatically include logs from lower levels.


Log Level Comparison​

LevelDescriptionIncludesRecommended Use
NONEDisables all logging output.–When logging is not needed.
ERRORError logs only.ERRORWhen you only need failure notifications.
WARNWarning and error logs.WARN, ERRORWhen you want visibility into potential issues alongside failures.
INFO (Default)High-level SDK activity and state transitions.INFO, WARN, ERRORGeneral monitoring of SDK activity, events, operations, and state changes.
DEBUGINFO logs plus detailed diagnostic information.DEBUG, INFO, WARN, ERRORInvestigating issues or when deeper diagnostic details are required.
ALLAll logs, including high-frequency real-time events.ALLDetailed analysis, troubleshooting complex scenarios, or low-level debugging.

Setting the Log Level​

The log level can be configured at any time:

  • Before joining a room
  • After joining a room
  • During runtime

setLogLevel() takes the level name as a string, such as "DEBUG", or a value of Constants.LogLevel, and returns a Promise. Await it. With no level, it applies the default, INFO. An unknown level rejects with ERROR_INVALID_PARAMETER (3073).

Your first setLogLevel() call also starts showing the SDK's logs in your app's JavaScript console, such as React Native DevTools. Call it when your app starts, so you also see the logs from joining a room.

tip

DEBUG and ALL logs are written with console.debug. React Native DevTools hides these by default. Select Verbose in the console's log level menu to see them.

ERROR logs are written with console.warn, so they do not open the red error overlay in your app.

Enable Logs​

import { setLogLevel } from "@videosdk.live/react-native-sdk";

const enableLogs = async () => {
await setLogLevel("DEBUG");
};

Read the Log Level​

getLogLevel() returns the level in force, such as "INFO". It returns "INFO" before any setLogLevel() call.

import { getLogLevel } from "@videosdk.live/react-native-sdk";

console.log("SDK log level:", getLogLevel());

Disable Logs​

import { setLogLevel } from "@videosdk.live/react-native-sdk";

const disableLogs = async () => {
await setLogLevel("NONE");
};

Got a Question? Ask us on discord