简体   繁体   English

如何在android中查看日志文件

[英]how to see the log file in android

I want a code for creating the log file in android and at the run time where to check where this log file is getting created, I also example for the same in java 我想要一个代码来在android中创建日志文件,并在运行时检查在哪里创建此日志文件,我也在Java中以相同的示例

Can we create a log file using predefined functions in android itself 我们可以使用android本身中的预定义功能创建日志文件吗

You can start your own process of logcat on the device, and redirect the output to some file. 您可以在设备上启动自己的logcat进程,然后将输出重定向到某个文件。 This is the basics ( do it on a separate thread) 这是基础(在单独的线程上执行)

Process logcat = Runtime.getRuntime().exec("logcat"); // start process
BufferedReader reader = new BufferedReader( new InputStreamReader(logcat.getInputStream())); // grab output stream
// store to file or print to screen

请参阅LogLogCat

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

相关问题 如何查看 Android Orchestrator 日志? - How to see the Android Orchestrator log? 在android logcat中缺少一些日志信息。如何查看所有日志cat详细信息/数据还是保存在文件中? - In android logcat some of the log information missing .How to see all log cat details/data or save in a file? android中的日志中看到多少个字符 - How many character see in the log in android 带有ADT的Android Eclipse:发生错误。 看日志文件 - Android Eclipse with ADT: An error has occurred. see the log file android设备监视器,发生错误,请参阅日志文件 - android device monitor, an error has occured, see the log file Android应用程序可以查看其自己的日志文件吗? - Is it possible for an Android application to see its own log file? 如何查看我的 android firebase mlkit 调用的 firebase 服务器日志? - How to see the firebase server log for my android firebase mlkit calls? Cordova - 如何在Android Emulator中查看错误和console.log - Cordova - How to see errors and console.log in Android Emulator 如何在Eclipse中查看Android的错误日志(logcat)? - How can I see the error log (logcat) for Android in Eclipse? 在Android(adb)中查看jar的日志 - See the log of a jar in android (adb)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM