APISonar


android.util.LocalLog.log

> android > util > LocalLog > log
android APIs util APIs LocalLog APIs log APIs

Example 1
private final LocalLog validationLogs = new LocalLog(NUM_VALIDATION_LOG_LINES);

    private void validationLog(String s) {
        if (DBG) log(s);
        validationLogs.log(s);
    }
Example 2
private final LocalLog mLocalLog;

    private void localLog(String s) {
        if (mLocalLog != null) {
            mLocalLog.log(s);
        }
    }
Example 3
private LocalLog mLocalLog;

    private void log(String logstring) {
        if (LOGD) Slog.d(TAG, logstring);
        mLocalLog.log(logstring);
    }
Example 4
private final LocalLog mLocalLog;

    private void logError(String fmt, Object... args) {
        final String msg = "ERROR " + String.format(fmt, args);
        Log.e(mTag, msg);
        mLocalLog.log(msg);
    }
Example 5
private final LocalLog mLocalLog;

    private String record(Category category, String msg) {
        final String entry = logLine(category, msg);
        mLocalLog.log(entry);
        return entry;
    }
Example 6
private final LocalLog mLocalLog;

    protected String getLogRecString(Message msg) {
        final String logLine = String.format(
                "%s/%d %d %d %s",
                mInterfaceName, mNetworkInterface == null ? -1 : mNetworkInterface.getIndex(),
                msg.arg1, msg.arg2, Objects.toString(msg.obj));

        final String richerLogLine = getWhatToString(msg.what) + " " + logLine;
        mLocalLog.log(richerLogLine);
        if (VDBG) {
            Log.d(mTag, richerLogLine);
        }

        return logLine;
    }
Example 7
private final LocalLog mWtfHistory;

    private void wtf(@Nullable Exception e, String fmt, Object...args) {
        final String message = String.format(fmt, args);
        synchronized (mLock) {
            mWtfHistory.log(message);
        }

        if (e != null) {
            Slog.wtf(TAG, message, e);
        } else {
            Slog.wtf(TAG, message);
        }
    }
Example 8
private final LocalLog mLog;

    public void start() {
        mLog.log(MARK_START);
        mPacketListener.start();
    }
Example 9
private final LocalLog mLog;

    public void stop() {
        mPacketListener.stop();
        mLog.log(MARK_STOP);
    }
Example 10
private final LocalLog mWakelockLogs = new LocalLog(MAX_WAKELOCK_LOGS);

    private void ensureNetworkTransitionWakelock(String forWhom) {
        synchronized (this) {
            if (mNetTransitionWakeLock.isHeld()) {
                return;
            }
            mNetTransitionWakeLock.acquire();
        }
        mWakelockLogs.log("ACQUIRE for " + forWhom);
        Message msg = mHandler.obtainMessage(EVENT_EXPIRE_NET_TRANSITION_WAKELOCK);
        mHandler.sendMessageDelayed(msg, mNetTransitionWakeLockTimeout);
    }
Example 11
private final LocalLog mWakelockLogs = new LocalLog(MAX_WAKELOCK_LOGS);

    private void handleReleaseNetworkTransitionWakelock(int eventId) {
        String event = eventName(eventId);
        synchronized (this) {
            if (!mNetTransitionWakeLock.isHeld()) {
                mWakelockLogs.log(String.format("RELEASE: already released (%s)", event));
                Slog.w(TAG, "expected Net Transition WakeLock to be held");
                return;
            }
            mNetTransitionWakeLock.release();
        }
        mWakelockLogs.log(String.format("RELEASE (%s)", event));
    }
Example 12
private final LocalLog mNetworkInfoBlockingLogs = new LocalLog(MAX_NETWORK_INFO_LOGS);

    private void maybeLogBlockedStatusChanged(NetworkRequestInfo nri, Network net,
            boolean blocked) {
        if (nri == null || net == null || !LOGD_BLOCKED_NETWORKINFO) {
            return;
        }
        String action = blocked ? "BLOCKED" : "UNBLOCKED";
        log(String.format("Blocked status changed to %s for %d(%d) on netId %d", blocked,
                nri.mUid, nri.request.requestId, net.netId));
        mNetworkInfoBlockingLogs.log(action + " " + nri.mUid);
    }
Example 13
public void sendActivitySnapshotLocked(@NonNull SnapshotData snapshotData) {
        final LocalLog logHistory = mService.getMaster().mRequestsHistory;
        if (logHistory != null) {
            logHistory.log("snapshot: id=" + mId);
        }

        if (mService.mRemoteService == null) {
            Slog.w(TAG, "sendActivitySnapshotLocked(): no remote service");
            return;
        }
        mService.mRemoteService.onActivitySnapshotRequest(mId, snapshotData);
    }
Example 14
private final LocalLog mNetworkRequestInfoLogs = new LocalLog(MAX_NETWORK_REQUEST_LOGS);

    private void handleRegisterNetworkRequest(NetworkRequestInfo nri) {
        mNetworkRequests.put(nri.request, nri);
        mNetworkRequestInfoLogs.log("REGISTER " + nri);
        if (!nri.isRequest) {
            for (NetworkAgentInfo network : mNetworkAgentInfos.values()) {
                if (network.satisfiesImmutableCapabilitiesOf(nri.request)) {
                    updateSignalStrengthThresholds(network);
                }
            }
        }
        rematchAllNetworksAndRequests(null, 0);
        if (nri.isRequest && mNetworkForRequestId.get(nri.request.requestId) == null) {
            sendUpdatedScoreToFactories(nri.request, 0);
        }
    }