aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Chabot <brettchabot@android.com>2010-07-12 11:29:44 -0700
committerBrett Chabot <brettchabot@android.com>2010-07-12 11:29:44 -0700
commite551cd75cfbbdd4ab4040b7d5c290a715e944305 (patch)
tree8dd0c89a5de989e1d66c2b36eecf33c880028b98
parenta46c5e60473548bbfa94f526ef68247b1470ca28 (diff)
downloadsdk-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.java9
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);
}
-
}