Skip to main content
Version: 5.x.x

Log Level – Flutter

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.

The SDK employs an event-driven logging model, where logs are generated only in response to SDK activity such as lifecycle events, state transitions, warnings, and errors. This ensures that logging remains lightweight and does not introduce unnecessary runtime overhead.

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

Enable Logs​

import 'package:videosdk/videosdk.dart';

VideoSDK.setLogLevel(LogLevel.DEBUG);

Disable Logs​

import 'package:videosdk/videosdk.dart';

VideoSDK.setLogLevel(LogLevel.NONE);

Read the current level with VideoSDK.getLogLevel(). It returns LogLevel.INFO until you call setLogLevel().

note

createRoom() no longer accepts debugMode. It has no replacement. To choose how much the SDK logs, use VideoSDK.setLogLevel().


Viewing Logs in flutter run​

The SDK writes its logs to Logcat on Android and to the Xcode console on iOS. flutter run shows only Dart output, so these logs do not appear there.

To see them in flutter run, forward them to your app with VideoSDK.enableLogForwarding().

import 'package:flutter/foundation.dart';
import 'package:videosdk/videosdk.dart';

Future<void> showSdkLogs() async {
VideoSDK.setLogLevel(LogLevel.DEBUG);

final bool forwarding = await VideoSDK.enableLogForwarding((level, message) {
debugPrint('[$level] $message');
});

if (!forwarding) {
debugPrint('Log forwarding is not available');
}
}
  • The listener receives the level of each log (error, warn, info or debug) and its message.
  • Forwarded logs follow the level you set with setLogLevel().
  • Calling enableLogForwarding() again replaces the listener.
  • enableLogForwarding() returns false when forwarding could not be turned on.

Stop Forwarding Logs​

import 'package:videosdk/videosdk.dart';

Future<void> hideSdkLogs() async {
await VideoSDK.disableLogForwarding();
}

Got a Question? Ask us on discord