Where can I view log of LOG(INFO) ?

771 views
Skip to first unread message

Hưng Vũ

unread,
Apr 20, 2020, 11:56:23 AM4/20/20
to android-platform
Hello everyone !
I am working with HAL and trying to view log from HAL layer. Almost of code of HAL uses ```android-base/logging.h``` header and prints log with ```LOG(INFO)``` function. Even though checking both ```dmesg``` and ```logcat```. I can find out where to view these logs.
Can anyone help me ?
Thank All !
Best Regard !

kiran kadam

unread,
Apr 20, 2020, 3:22:29 PM4/20/20
to android-...@googlegroups.com
Hi Hung,

check if macro #define LOG_NDEBUG 0 is commented in HAL files. you can use ALOGE to print logs and logs can be seen in logcat.

Thanks,
Kiran

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/b7d2a0f3-d6a6-4686-a093-4ef0d449a6e6%40googlegroups.com.


--
Regards,
Kiran Kadam

Hưng Vũ

unread,
Apr 21, 2020, 10:33:03 AM4/21/20
to android-platform
Thanks for your help ! I have tried it, but neither #define LOG_NDEBUG 0 and ALOGE didn't print logs.  Exclusively, when i used LOG(FATAL), it have an effect.

Vào 02:22:29 UTC+7 Thứ Ba, ngày 21 tháng 4 năm 2020, kiran kadam đã viết:
Hi Hung,

check if macro #define LOG_NDEBUG 0 is commented in HAL files. you can use ALOGE to print logs and logs can be seen in logcat.

Thanks,
Kiran

On Mon, Apr 20, 2020 at 9:26 PM Hưng Vũ <hungvu...@gmail.com> wrote:
Hello everyone !
I am working with HAL and trying to view log from HAL layer. Almost of code of HAL uses ```android-base/logging.h``` header and prints log with ```LOG(INFO)``` function. Even though checking both ```dmesg``` and ```logcat```. I can find out where to view these logs.
Can anyone help me ?
Thank All !
Best Regard !

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-...@googlegroups.com.


--
Regards,
Kiran Kadam

Tommaso Merciai

unread,
Apr 21, 2020, 1:13:13 PM4/21/20
to android-...@googlegroups.com
Hi Hung,
Have you try to ask to logcat to be verbose as possible, try to use the following command:
$ logcat -b all -v time *:V

Regards,
Tommaso



To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/87fbbd78-c896-40e2-8a4e-356a811a0dcb%40googlegroups.com.

kiran kadam

unread,
Apr 21, 2020, 5:54:12 PM4/21/20
to android-...@googlegroups.com
Hi Hung,
Can you provide more details like file name ,android version etc 

Thanks 




To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/87fbbd78-c896-40e2-8a4e-356a811a0dcb%40googlegroups.com.

Hưng Vũ

unread,
Apr 22, 2020, 10:52:11 AM4/22/20
to android-platform
Thank Tommaso,
I'm working with the other types of log such as error , info,... they're on higher level of verbose 

Regards,
Hung

Vào 00:13:13 UTC+7 Thứ Tư, ngày 22 tháng 4 năm 2020, Tommaso Merciai đã viết:

Hưng Vũ

unread,
Apr 22, 2020, 10:52:11 AM4/22/20
to android-platform
It's a service.cpp file written by me:
```
#define LOG_TAG "android.hard...@2.0-service"

#include <hidl/HidlSupport.h>
#include <hidl/HidlTransportSupport.h>
#include <android-base/logging.h>
#include <android/hardware/hvuleds/2.0/IHvuleds.h>
#include "Hvuleds.h"
#include <utils/Log.h>

#define LOG_NDEBUG 0
...
int main() {
ALOGE("hungvu: Hvuleds start HAL");
LOG(ERROR) << "hungvu: Hvuleds start HAL";
...
}
```
Definitely, This service is initialized in init process and perform well on my device. But, I don't know why it doesn't print log on logcat or dmesg. Only LOG(FATAL) has an effect and abort my service.





Vào 04:54:12 UTC+7 Thứ Tư, ngày 22 tháng 4 năm 2020, kiran kadam đã viết:
Reply all
Reply to author
Forward
0 new messages