简体   繁体   English

如何在Android的JNI中实现调试日志

[英]How to implement debug logs in Android's JNI

I am trying to implement debug logs in the following file in the android code. 我正在尝试在android代码中的以下文件中实现调试日志。

frameworks/base/services/jni/com_android_server_BatteryService.cpp frameworks / base / services / jni / com_android_server_BatteryService.cpp

I have tried LOGE and __android_log_write(), however things doesn't work. 我已经尝试过LOGE和__android_log_write(),但是事情不起作用。 I have also tried to create a text file in the filesystem and then write it, however this also didnt work. 我也曾尝试在文件系统中创建一个文本文件,然后将其写入,但是这也没有用。

#define LOG_TAG "BatteryService"
#include "utils/Log.h"

/* some code*/

LOGE("Mine logging is better than yours.");

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

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