skip to Main Content

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


  1. Review if your logcat on Android has a filter.
    You can use elaborated lib to have custom logs:

    Login or Signup to reply.
    • Android Studio
      You can see the output from Debug instead of Logcat 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 on Logcat.

    • Visual Studio Code
      You can see the output from Debug Console on the bottom (left/right/top) bar (View->Debug Console) by filtering the text you want.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search