如何获取详细的日志记录logcat中的特定模块 [英] How to get Verbose logging in logcat for a specific module

查看:732
本文介绍了如何获取详细的日志记录logcat中的特定模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个android的模块(AudioFlinger)中有详细的日志记录(与标签= AudioFlinger)的支持。
问题是,我怎么能看到这些日志中的logcat的?

One of the android Modules (AudioFlinger) has support for verbose logging (with Tag=AudioFlinger). Question is how can I see those logs in the logcat?

我做了setprop log.tag.AudioFlinger详细 - 但它似乎并没有工作。我需要改变一些东西,然后再重建Android源?

I did the setprop log.tag.AudioFlinger VERBOSE - but it doesn't seem to work. Do I need to change something and then rebuild the android source again?

推荐答案

在logcat的文档并不能真正帮助。但更多的挖我能找到答案,因为我期待的详细日志记录默认情况下关闭在编译的时候。

The logcat documentation doesn't really help. But with more digging I was able to find the answer, as I was expecting the VERBOSE logging is by default OFF at compile time.

纵观cutils / log.h有助于找到了答案:
<一href=\"http://www.netmite.com/android/mydroid/system/core/include/cutils/log.h\">http://www.netmite.com/android/mydroid/system/core/include/cutils/log.h

Looking at the cutils/log.h helps to find the answer: http://www.netmite.com/android/mydroid/system/core/include/cutils/log.h

/*
 * Normally we strip LOGV (VERBOSE messages) from release builds.
 * You can modify this (for example with "#define LOG_NDEBUG 0"
 * at the top of your source file) to change that behavior.
 */

所以要启用详细任何源文件/模块:我们必须定义为LOG_NDEBUG 0

So to enable VERBOSE for any source file/module : We have to define LOG_NDEBUG as 0

这篇关于如何获取详细的日志记录logcat中的特定模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆