how to enable logs


Last Updated:

  1. Karan_Aricent

    Karan_Aricent Member This Topic's Starter

    Joined:
    Jun 25, 2010
    Messages:
    9
    Likes Received:
    0
    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

    Joined:
    Jun 14, 2010
    Messages:
    20
    Likes Received:
    0
    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

    Joined:
    Jun 14, 2010
    Messages:
    20
    Likes Received:
    0
    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

    James McMurray Member

    Joined:
    May 5, 2009
    Messages:
    18
    Likes Received:
    0
    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...