diff options
author | Brett Chabot <brettchabot@android.com> | 2010-07-12 11:29:44 -0700 |
---|---|---|
committer | Brett Chabot <brettchabot@android.com> | 2010-07-12 11:29:44 -0700 |
commit | e551cd75cfbbdd4ab4040b7d5c290a715e944305 (patch) | |
tree | 8dd0c89a5de989e1d66c2b36eecf33c880028b98 | |
parent | a46c5e60473548bbfa94f526ef68247b1470ca28 (diff) | |
download | sdk-e551cd75cfbbdd4ab4040b7d5c290a715e944305.zip sdk-e551cd75cfbbdd4ab4040b7d5c290a715e944305.tar.gz sdk-e551cd75cfbbdd4ab4040b7d5c290a715e944305.tar.bz2 |
Add hours to ddms log timestamp.
Change-Id: I293b049e73e4776d969706b28ae7533ed581dfcd
-rw-r--r-- | ddms/libs/ddmlib/src/com/android/ddmlib/Log.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/Log.java b/ddms/libs/ddmlib/src/com/android/ddmlib/Log.java index e24c353..55f7aab 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/Log.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/Log.java @@ -18,6 +18,8 @@ package com.android.ddmlib; import java.io.PrintWriter; import java.io.StringWriter; +import java.text.SimpleDateFormat; +import java.util.Date; /** * Log class that mirrors the API in main Android sources. @@ -347,13 +349,10 @@ public final class Log { * @param message */ public static String getLogFormatString(LogLevel logLevel, String tag, String message) { - long msec; - - msec = System.currentTimeMillis(); - return String.format("%02d:%02d %c/%s: %s\n", (msec / 60000) % 60, (msec / 1000) % 60, + SimpleDateFormat formatter = new SimpleDateFormat("hh:mm:ss"); + return String.format("%s %c/%s: %s\n", formatter.format(new Date()), logLevel.getPriorityLetter(), tag, message); } - } |