Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print log in android c++ file?

I added

#define LOG_NDEBUG 0
#define LOG_TAG "StagefrightMediaScanner"
#include <utils/Log.h>

in the libstagefright/StagefrightMediaScanner.cpp

but can not print anything using LOGV and LOGE, does any other things can I need to do?

like image 806
Victor S Avatar asked Aug 28 '12 03:08

Victor S


People also ask

How do I print a log message on android?

Print : Click to print the logcat messages. After selecting your print preferences in the dialog that appears, you can also choose to save to a PDF. Restart : Click to clear the log and restart logcat.

How do I view android logs?

To access the logging output, run the 'adb' executable with following arguments to capture the Android Enterprise related logging: Windows: C:\Users\[username]\AppData\Local\Android\sdk\platform-tools> adb logcat -G 32M; adb shell setprop persist. log.

How do I get ADB logs from my Android?

Navigate to device settings and enable Developer Options (see section for ADB logs) Navigate to Developer Options and tap on Take/Submit Bug Report. Select Full Report when prompted to get the full device info along with the logs.

Where is the log file in Android Studio?

you can find the log in the bottom of the IDE, click the "Gradle Console", and then choose the "Android Monitor". You will see a Droplistbox control which shows "Verbose" as a default value. If you use log. v() .


1 Answers

You can use the following code to get Log

  __android_log_print(ANDROID_LOG_ERROR, "TRACKERS", "%s", Str);

and add the following header file

#include <android/log.h>
like image 177
Usman Kurd Avatar answered Oct 11 '22 16:10

Usman Kurd