I know based on documentation that
Debugging information is stripped out. Debugging is disabled.
But can we somehow force to print logs, or maybe debug in release mode? "production app" I'm using Android Studio.
For example while developing android app in AS we are able to print logs
android:debuggable="true"
5 Answers 5
Plug your phone (if it is the case) on your computer and type on terminal:
$ flutter logs
You should be able to choose the device you want to see logs.
To check all available devices run flutter devices
Then run the below command to run the app in release mode with the logs
flutter run -d [deviceID] --release
1 Comment
-d [deviceID] you will be able to pick from the devices list right after executing flutter run --releaseTo display information that you would like to be visible in release mode ('production code') of your flutter app, simply use print() method. For info you want to hide in console log use debugPrint().
Maybe this part of documentation will help.
1 Comment
If you are using logger package, you must add a permissive filter, since the default one only prints on debug:
import 'package:logger/logger.dart';
class PermissiveFilter extends LogFilter {
@override
bool shouldLog(LogEvent event) => true;
}
var logger = logger(filter: PermissiveFilter());
Comments
If you use logger, pass filter parameter.
Logger(
printer: PrettyPrinter(
methodCount: 1,
printEmojis: false,
colors: false,
dateTimeFormat: DateTimeFormat.onlyTime,
noBoxingByDefault: true,
),
output: _output,
filter: ProductionFilter(), // here!
);
Comments
Explore related questions
See similar questions with these tags.