I am running flutter on a real device and print(), log(), debugprint() does not work.
Is there any alternative?
try {
final email = _emailController.text;
final password = _passwordController.text;
final userCredential = FirebaseAuth.instance.signInWithEmailAndPassword(email: email, password: password);
print(userCredential);
} on FirebaseAuthException catch (e) {
log(e.code);
debugprint(e.code);
print(e.code);
}
2
Answers
Review if your logcat on Android has a filter.
You can use elaborated lib to have custom logs:
You can see the output from
Debug
instead ofLogcat
on the sidebar or bottom bar. Furthermore, you can also tap the output region and use combination keys ctrl+F (cmd+F on MacOS) to find the text you want.BTW, you still can use
MethodChannel
on Flutter to call methods in Android or Java provided with Log, Log4J, Logger or XLog and etc. in order that the print can show onLogcat
.You can see the output from
Debug Console
on the bottom (left/right/top) bar (View->Debug Console) by filtering the text you want.