简体   繁体   English

如何在应用程序中读取FirebaseDatabase DEBUG日志?

[英]How to read FirebaseDatabase DEBUG logs in app?

I'm trying to figure out an issue and it could be helpful to analyze the FirebaseDatabase DEBUG logs during the app execution to display useful information to the user or take decisions (for example retry some operations). 我正在尝试找出问题,在执行应用程序期间分析FirebaseDatabase DEBUG日志以向用户显示有用信息或做出决定(例如重试某些操作)可能会有所帮助。

I found the following instruction to set the FirebaseDatabase logs to debug but my problem is that it seems that the logs are only logged on logcat and from the app execution there isn't any chance to retrieve any log. 我发现以下指令将FirebaseDatabase日志设置为调试,但是我的问题是,日志似乎仅记录在logcat上,并且从应用程序执行中没有机会检索任何日志。

FirebaseDatabase.getInstance().setLogLevel(Logger.Level.DEBUG)

Is it possible to access to these logs on app? 是否可以访问应用程序上的这些日志?

Thanks! 谢谢!

Manuela. 曼努埃拉。

Logs don't go away when an app terminates. 应用终止时日志不会消失。 If you're using Android Studio, you have to use the dropdown to indicate that you want to view all of the logs (not just the ones from a currently running process). 如果您使用的是Android Studio,则必须使用下拉菜单指示您要查看所有日志(而不仅仅是查看当前正在运行的进程中的日志)。 Or you can use adb logcat to view them from a command prompt. 或者,您可以使用adb logcat从命令提示符下查看它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM