1. Check out our app, Forums for Android! Download and leave feedback here!

how to enable logs

Discussion in 'Application Development' started by Karan_Aricent, Jul 22, 2010.

  1. Karan_Aricent

    Karan_Aricent Member
    Thread Starter
    25

    Jun 25, 2010
    9
    0
    25
    Software Engineer
    Gurgaon
    Hi,

    I want to know that how to enable all logs in android. iwant to see logs using a G1 device.

    Regards,
    Karan.
     

    Advertisement

  2. ophanin

    ophanin Member
    35

    Jun 14, 2010
    20
    0
    35
    Graduate Student
    Rochester, NY
    Like in your own code?

    To do that, in your program, you import android.util.Log and then call 'Log.x', where x can be i (info), e (error), d (debug), etc. Generally, the arguments are then a debug tag (to be able to identify it amongst the other logs) and the actual log message.

    My example:
    final string DEBUG_TAG = "MyAwesomeApp"
    Log.i(DEBUG_TAG, "This is my message");
     
  3. ophanin

    ophanin Member
    35

    Jun 14, 2010
    20
    0
    35
    Graduate Student
    Rochester, NY
    Oh, and then to seem them, use the DDMS tool. I've only used it through the DDMS view in Eclipse, but I am sure that there is a standalone log reader among the Android SDK tooks.
     
  4. James McMurray

    15

    May 5, 2009
    18
    0
    15
    If you just want to see what logs your phone is spitting out as you use it, there are android apps for that. Search the market for aLog.
     

Share This Page

Loading...