Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print log of library project in android?

I have one android project in which I have included 3 other android library project and I am using eclipse. I have tried to print log from the library project, but it only prints the log of the main project only.

So can any body tell me how to print the log of library project which is included in the main project?

My main project is com.project1.app, in which I logged as below.

Log.i(TAG,"Log From Main Project1");

Library project is com.subLibrary.subLibraryapp, in which I logged as below.

Log.i(TAG,"Log From Main Library Project");

But in LogCat I am able to see log only from com.project1.app shown as below.

com.project1.app    |   Log From Main Project1

Have I done any mistake or I have to open any other window, Can anybody please suggest me?

like image 944
Jayeshkumar Sojitra Avatar asked Mar 02 '13 06:03

Jayeshkumar Sojitra


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 log files on Android?

Android 4.0 and older You can either download the SDK and use adb logcat or get Logcat Extrem from the Google Play Store, which shows the log directly on your phone. Alternatively, you can use Terminal Emulator with command "logcat > /sdcard/log. txt" for continuous writing of the log to a file on the SD Card.

What is a Logcat in Android?

Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class. This page is about the command-line logcat tool, but you can also view log messages from the Logcat window in Android Studio.


Video Answer


1 Answers

I'm guessing that your application and the library have different tags.

If you're using the command line to read logs, you need to do something like

adb logcat -s yourtag:V librarytag:V

If you're using Eclipse to read your logcat output, try creating a filter specific to your app.

like image 113
Edward Falk Avatar answered Oct 17 '22 02:10

Edward Falk