1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 13:12:25 -05:00

standardize the formats of our wakelock messages to be able to better audit them

This commit is contained in:
Jesse Vincent 2011-01-13 01:18:40 +00:00
parent e56b044bbc
commit da22ffdcea

View File

@ -60,7 +60,7 @@ public class TracingPowerManager
id = wakeLockId.getAndIncrement(); id = wakeLockId.getAndIncrement();
if (K9.DEBUG) if (K9.DEBUG)
{ {
Log.v(K9.LOG_TAG, "Creating TracingWakeLock for tag " + tag + " with id " + id); Log.v(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id+ ": Create");
} }
} }
public void acquire(long timeout) public void acquire(long timeout)
@ -71,8 +71,7 @@ public class TracingPowerManager
} }
if (K9.DEBUG) if (K9.DEBUG)
{ {
Log.v(K9.LOG_TAG, "Acquired TracingWakeLock for tag " + tag + " and id " + id Log.v(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + " for " + timeout + " ms: acquired");
+ " for " + timeout + " ms");
} }
raiseNotification(); raiseNotification();
if (startTime == null) if (startTime == null)
@ -90,8 +89,7 @@ public class TracingPowerManager
raiseNotification(); raiseNotification();
if (K9.DEBUG) if (K9.DEBUG)
{ {
Log.w(K9.LOG_TAG, "Acquired TracingWakeLock for tag " + tag + " and id " + id Log.w(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": acquired with no timeout. K-9 Mail should not do this");
+ " with no timeout. K-9 Mail should not do this");
} }
if (startTime == null) if (startTime == null)
{ {
@ -113,15 +111,14 @@ public class TracingPowerManager
Long endTime = System.currentTimeMillis(); Long endTime = System.currentTimeMillis();
if (K9.DEBUG) if (K9.DEBUG)
{ {
Log.v(K9.LOG_TAG, "Releasing TracingWakeLock for tag " + tag + " and id " + id + " after " Log.v(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": releasing after " + (endTime - startTime) + " ms, timeout = " + timeout + " ms");
+ (endTime - startTime) + " ms, timeout = " + timeout + " ms");
} }
} }
else else
{ {
if (K9.DEBUG) if (K9.DEBUG)
{ {
Log.v(K9.LOG_TAG, "Releasing TracingWakeLock for tag " + tag + " and id " + id + ", timeout = " + timeout + " ms"); Log.v(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ", timeout = " + timeout + " ms: releasing");
} }
} }
cancelNotification(); cancelNotification();
@ -163,13 +160,13 @@ public class TracingPowerManager
if (startTime != null) if (startTime != null)
{ {
Long endTime = System.currentTimeMillis(); Long endTime = System.currentTimeMillis();
Log.i(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " and id " + id + " has been active for " Log.i(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": has been active for "
+ (endTime - startTime) + " ms, timeout = " + timeout + " ms"); + (endTime - startTime) + " ms, timeout = " + timeout + " ms");
} }
else else
{ {
Log.i(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " and id " + id + " still active, timeout = " + timeout + " ms"); Log.i(K9.LOG_TAG, "TracingWakeLock for tag " + tag + " / id " + id + ": still active, timeout = " + timeout + " ms");
} }
} }