I need to get the Android device timestamp in the format hh:mm:ss:SS. I am able to view the time displayed in the Logcat of Eclipse. Is it the computer\'s time or is it the Andr
long, threadtime or time formats with logcat -v logcat has a number of format options, which can be passed to the -v flag in the command line. You can view all of the formats in the documentation here.
Here are samples of what each option looks like so you can decide which one suits your needs:
briefDisplay priority, tag, and PID of the process issuing the message.
D/StatusBar.NetworkController( 1222): refreshNwBoosterIndicator - setNWBoosterIndicators(false)
D/StatusBar.NetworkController( 1222): refreshNwBoosterIndicator - setNWBoosterIndicators(false)
longDisplay all metadata fields and separate messages with blank lines.
(I like this the best, but I'm a sucker for whitespace.)
[ 01-27 13:17:07.703 1222: 1222 D/StatusBar.NetworkController ]
refreshNwBoosterIndicator - setNWBoosterIndicators(false)
[ 01-27 13:17:07.703 1222: 1222 D/StatusBar.NetworkController ]
refreshNwBoosterIndicator - setNWBoosterIndicators(false)
processDisplay PID only.
D( 1222) refreshNwBoosterIndicator - setNWBoosterIndicators(false) (StatusBar.NetworkController)
D( 1222) refreshNwBoosterIndicator - setNWBoosterIndicators(false) (StatusBar.NetworkController)
rawDisplay the raw log message with no other metadata fields.
refreshNwBoosterIndicator - setNWBoosterIndicators(false)
refreshNwBoosterIndicator - setNWBoosterIndicators(false)
tagDisplay the priority and tag only.
D/StatusBar.NetworkController: refreshNwBoosterIndicator - setNWBoosterIndicators(false)
D/StatusBar.NetworkController: refreshNwBoosterIndicator - setNWBoosterIndicators(false)
threadA legacy format that shows priority, PID, and TID of the thread issuing the message.
D( 1222: 1222) refreshNwBoosterIndicator - setNWBoosterIndicators(false)
D( 1222: 1222) refreshNwBoosterIndicator - setNWBoosterIndicators(false)
threadtimeDisplay the date, invocation time, priority, tag, PID, and TID of the thread issuing the message.
(The docs say this is the default but not true in my case.)
01-27 13:17:07.703 1222 1222 D StatusBar.NetworkController: refreshNwBoosterIndicator - setNWBoosterIndicators(false)
01-27 13:17:07.703 1222 1222 D StatusBar.NetworkController: refreshNwBoosterIndicator - setNWBoosterIndicators(false)
timeDisplay the date, invocation time, priority, tag, and PID of the process issuing the message.
01-27 13:17:07.703 D/StatusBar.NetworkController( 1222): refreshNwBoosterIndicator - setNWBoosterIndicators(false)
01-27 13:17:07.703 D/StatusBar.NetworkController( 1222): refreshNwBoosterIndicator - setNWBoosterIndicators(false)
NOTE: If you're using this in your app to programmatically collect your User's device logs to send to your support team or whatever, you need to omit the space between -v and the format, like so:
commandLine.add( "-vlong" )
Not sure why it's like that but hopefully that saves somebody time trying to figure that out.