Methods Summary |
---|
private static java.lang.String | buildMessage(java.lang.String message, android.util.Pair timing)
return new StringBuilder()
.append("[").append(timing == null ? 1 : timing.second).append("]:")
.append(message).toString();
|
static final void | debug(java.lang.String logMessage, java.lang.Object objs)
getLogger().debugInternal(toLogString(logMessage, objs));
|
private void | debugInternal(java.lang.String logMessage)
if (true || IS_USER_BUILD) {
return;
}
Slog.d(TAG, logMessage);
|
static final void | error(java.lang.String logMessage, java.lang.Object objs)
getLogger().errorInternal(toLogString(logMessage, objs));
|
private void | errorInternal(java.lang.String logMessage)
String log = updateLog(mErrorTimingCache, logMessage);
if (!log.isEmpty()) {
Slog.e(TAG, log);
}
|
private static com.android.server.hdmi.HdmiLogger | getLogger()
HdmiLogger logger = sLogger.get();
if (logger == null) {
logger = new HdmiLogger();
sLogger.set(logger);
}
return logger;
|
private static void | increaseLogCount(java.util.HashMap cache, java.lang.String message)
Pair<Long, Integer> timing = cache.get(message);
if (timing != null) {
cache.put(message, new Pair<>(timing.first, timing.second + 1));
}
|
private static boolean | shouldLogNow(android.util.Pair timing, long curTime)
return timing == null || curTime - timing.first > ERROR_LOG_DURATTION_MILLIS;
|
private static final java.lang.String | toLogString(java.lang.String logMessage, java.lang.Object[] objs)
if (objs.length > 0) {
return String.format(logMessage, objs);
} else {
return logMessage;
}
|
private static java.lang.String | updateLog(java.util.HashMap cache, java.lang.String logMessage)
long curTime = SystemClock.uptimeMillis();
Pair<Long, Integer> timing = cache.get(logMessage);
if (shouldLogNow(timing, curTime)) {
String log = buildMessage(logMessage, timing);
cache.put(logMessage, new Pair<>(curTime, 1));
return log;
} else {
increaseLogCount(cache, logMessage);
}
return "";
|
static final void | warning(java.lang.String logMessage, java.lang.Object objs)
getLogger().warningInternal(toLogString(logMessage, objs));
|
private void | warningInternal(java.lang.String logMessage)
String log = updateLog(mWarningTimingCache, logMessage);
if (!log.isEmpty()) {
Slog.w(TAG, log);
}
|