Android的设置日志级别级别、日志、Android

2023-09-05 03:42:46 作者:欲望失宠

是否可以设置设备上的日志级别的根源并非是? 所以我想以某种方式改变设备的日志级别设置为调试。这事可以做?

Is it possible to set the log levels on a device that is not rooted? so I want to change the device log level somehow to "debug". is this something that can be done?

因为它不是源于我不认为setprop会工作。 我也改变不了local.prop文件,因为我没有权限这么做。

since its not rooted i dont think setprop will work. i can also not change the local.prop file since i do not have permissions to do so.

比可能得到幸运,找到一个隐藏的菜单有日志级别在里面等。 有没有办法对我来说,提升日志级别,一些其他的方式?

other than maybe getting lucky and finding a hidden menu that has the log levels in it. is there a way for me to enhance the log level some other way?

感谢您的帮助。

推荐答案

setprop

是临时的,直到你重新启动您的设备,即使是在扎根手机。 您可以通过重新启动,如果你把它们写入 local.prop 这是唯一可能在植根手机持续性。 在某些属性是只读的,如果你改变一些初始化文件只能被改变。这可能是甚至是不可能的植根手机。 在每个设备(或固件)可以有不同的属性集。有根的手机就不会自动多。 is temporary until you reboot your device, even on rooted phones. you can persist properties through reboots if you write them into local.prop which is only possible on rooted phones. some properties are read-only and can only be changed if you change some init files. That might be even impossible on rooted phones. each device (or firmware) can have a different set of properties. A rooted phone wouldn't have automatically more.

记录等级:

如果是打印记录的code说 Log.d()那么这将是在调试水平,你不能改变,除非你改变code和重新编译它。没有什么隐藏日志消息如果您执行登录?不分级别。 Android框架隐藏了一些日志信息,如果你有你的固件的发布版本。为了显示那些你需要重新编译固件调试版本。没有机会得到那些无论是在根深蒂固的手机显示。 在一些消息是由在code像的局部变量控制的,如果(LOCAL_LOGV)Log.v(... - 你需要更改code在这里看到这些了。 在一些消息是由 Config.LOGV 控制(=总是)看到的