Flutter console logs
The SDK records the console logs of your Flutter app in an activity log that accompanies every bug report, crash report and error report in the Appelium Dashboard. Unlike print() and debugPrint(), Appelium logs have levels and optional domains, so you can filter what happened before an issue without access to the user's phone. If you already log with package:logging, you can route its records to Appelium instead.
Write logs
Logs are recorded as soon as the SDK is started, whichever features you enable. Use one method per level:
AppeliumFeedback.logVerbose('Verbose statement');
AppeliumFeedback.logDebug('Debug statement');
AppeliumFeedback.logInfo('Info statement');
AppeliumFeedback.logWarning('Warning statement');
AppeliumFeedback.logError('Error statement');
AppeliumFeedback.log(message) is a shortcut for logDebug(message).
Every level accepts an optional domain, which groups related logs and is shown with each log line in the Dashboard:
AppeliumFeedback.logError('Transaction failed', domain: 'Payment');
Keep domains few and stable, such as Payment, Login or Sync.
What gets recorded
- Only messages logged through the Appelium methods or
package:loggingbelow. Output ofprint(),debugPrint()anddart:developer'slog(), and the errors that Flutter prints, are not captured. - Appelium logs are not printed to the console.
- Messages longer than 25,000 characters, counted as UTF-16 code units (
message.length), are truncated to 24,999 followed by…. - Blank messages are ignored.
- Calls made before
startare ignored, and fail an assertion in debug builds. - Reports include the logs of the retention period, by default the last 180 seconds.
- Logs are uploaded only as part of a report.
Logs from your app's Swift or Kotlin code, written with the native SDK, go to the same activity log.
Do not log passwords, tokens or other personal data you do not need for debugging.
package:logging
Already using package:logging? Forward its records with AppeliumLogHandler, after starting the SDK:
import 'package:appelium_feedback/appelium_feedback.dart';
import 'package:logging/logging.dart';
Logger.root.level = Level.ALL;
Logger.root.onRecord.listen(const AppeliumLogHandler().call);
- The logger's name becomes the domain.
- A record's error and stack trace are added to its message.
- The levels map to the Appelium levels like this:
package:logging |
Appelium |
|---|---|
FINEST, FINER |
Verbose |
FINE, CONFIG |
Debug |
INFO |
Info |
WARNING |
Warning |
SEVERE, SHOUT |
Error |
Custom levels map to the next lower standard level. Records below the level of Logger.root never reach the handler.