当前位置: 首页>>代码示例>>Java>>正文


Java Logger.log方法代码示例

本文整理汇总了Java中com.facebook.internal.Logger.log方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.log方法的具体用法?Java Logger.log怎么用?Java Logger.log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.internal.Logger的用法示例。


在下文中一共展示了Logger.log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processError

import com.facebook.internal.Logger; //导入方法依赖的package包/类
@Override
protected void processError(FacebookRequestError error) {
    int errorCode = error.getErrorCode();
    if (errorCode == ERROR_CODE_OBJECT_ALREADY_LIKED) {
        // This isn't an error for us. Client was just out of sync with server
        // This will prevent us from showing the dialog for this.

        // However, there is no unliketoken. So a subsequent unlike WILL show the dialog
        this.error = null;
    } else {
        Logger.log(LoggingBehavior.REQUESTS,
                TAG,
                "Error liking object '%s' with type '%s' : %s",
                objectId,
                objectType,
                error);
        logAppEventForError("publish_like", error);
    }
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:20,代码来源:LikeActionController.java

示例2: save

import com.facebook.internal.Logger; //导入方法依赖的package包/类
/**
 * Persists all supported data types present in the passed in Bundle, to the
 * cache
 *
 * @param bundle
 *          The Bundle containing information to be cached
 */
public void save(Bundle bundle) {
    Validate.notNull(bundle, "bundle");

    SharedPreferences.Editor editor = cache.edit();

    for (String key : bundle.keySet()) {
        try {
            serializeKey(key, bundle, editor);
        } catch (JSONException e) {
            // Error in the bundle. Don't store a partial cache.
            Logger.log(LoggingBehavior.CACHE, Log.WARN, TAG, "Error processing value for key: '" + key + "' -- " + e);

            // Bypass the commit and just return. This cancels the entire edit transaction
            return;
        }
    }

    boolean successfulCommit = editor.commit();
    if (!successfulCommit) {
        Logger.log(LoggingBehavior.CACHE, Log.WARN, TAG, "SharedPreferences.Editor.commit() was not successful");
    }
}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:30,代码来源:SharedPreferencesTokenCachingStrategy.java

示例3: load

import com.facebook.internal.Logger; //导入方法依赖的package包/类
/**
 * Returns a Bundle that contains the information stored in this cache
 *
 * @return A Bundle with the information contained in this cache
 */
public Bundle load() {
    Bundle settings = new Bundle();

    Map<String, ?> allCachedEntries = cache.getAll();

    for (String key : allCachedEntries.keySet()) {
        try {
            deserializeKey(key, settings);
        } catch (JSONException e) {
            // Error in the cache. So consider it corrupted and return null
            Logger.log(LoggingBehavior.CACHE, Log.WARN, TAG,
                    "Error reading cached value for key: '" + key + "' -- " + e);
            return null;
        }
    }

    return settings;
}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:24,代码来源:SharedPreferencesTokenCachingStrategy.java

示例4: createResponsesFromString

import com.facebook.internal.Logger; //导入方法依赖的package包/类
static List<GraphResponse> createResponsesFromString(
        String responseString,
        HttpURLConnection connection,
        GraphRequestBatch requests
) throws FacebookException, JSONException, IOException {
    JSONTokener tokener = new JSONTokener(responseString);
    Object resultObject = tokener.nextValue();

    List<GraphResponse> responses = createResponsesFromObject(
            connection,
            requests,
            resultObject);
    Logger.log(
            LoggingBehavior.REQUESTS,
            RESPONSE_LOG_TAG,
            "Response\n  Id: %s\n  Size: %d\n  Responses:\n%s\n",
            requests.getId(),
            responseString.length(),
            responses);

    return responses;
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:23,代码来源:GraphResponse.java

示例5: load

import com.facebook.internal.Logger; //导入方法依赖的package包/类
public Bundle load() {
    Bundle settings = new Bundle();

    Map<String, ?> allCachedEntries = cache.getAll();

    for (String key : allCachedEntries.keySet()) {
        try {
            deserializeKey(key, settings);
        } catch (JSONException e) {
            // Error in the cache. So consider it corrupted and return null
            Logger.log(LoggingBehavior.CACHE, Log.WARN, TAG,
                    "Error reading cached value for key: '" + key + "' -- " + e);
            return null;
        }
    }

    return settings;
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:19,代码来源:LegacyTokenHelper.java

示例6: save

import com.facebook.internal.Logger; //导入方法依赖的package包/类
public void save(Bundle bundle) {
    Validate.notNull(bundle, "bundle");

    SharedPreferences.Editor editor = cache.edit();

    for (String key : bundle.keySet()) {
        try {
            serializeKey(key, bundle, editor);
        } catch (JSONException e) {
            // Error in the bundle. Don't store a partial cache.
            Logger.log(
                    LoggingBehavior.CACHE,
                    Log.WARN,
                    TAG,
                    "Error processing value for key: '" + key + "' -- " + e);

            // Bypass the commit and just return. This cancels the entire edit transaction
            return;
        }
    }
    editor.apply();
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:23,代码来源:LegacyTokenHelper.java

示例7: save

import com.facebook.internal.Logger; //导入方法依赖的package包/类
/**
 * Persists all supported data types present in the passed in Bundle, to the
 * cache
 *
 * @param bundle
 *          The Bundle containing information to be cached
 */
public void save(Bundle bundle) {
    Validate.notNull(bundle, "bundle");

    SharedPreferences.Editor editor = cache.edit();

    for (String key : bundle.keySet()) {
        try {
            serializeKey(key, bundle, editor);
        } catch (JSONException e) {
            // Error in the bundle. Don't store a partial cache.
            Logger.log(LoggingBehavior.CACHE, Log.WARN, TAG, "Error processing value for key: '" + key + "' -- " + e);

            // Bypass the commit and just return. This cancels the entire edit transaction
            return;
        }
    }
    editor.apply();
}
 
开发者ID:dannegm,项目名称:BrillaMXAndroid,代码行数:26,代码来源:SharedPreferencesTokenCachingStrategy.java

示例8: onSuspend

import com.facebook.internal.Logger; //导入方法依赖的package包/类
void onSuspend(AppEventsLogger logger, long eventTime) {
    if (!isAppActive) {
        Logger.log(LoggingBehavior.APP_EVENTS, TAG, "Suspend for inactive app");
        return;
    }

    long now = eventTime;
    long delta = (now - lastResumeTime);
    if (delta < 0) {
        Logger.log(LoggingBehavior.APP_EVENTS, TAG, "Clock skew detected");
        delta = 0;
    }
    millisecondsSpentInSession += delta;
    lastSuspendTime = now;
    isAppActive = false;
}
 
开发者ID:yudiandreanp,项目名称:SocioBlood,代码行数:17,代码来源:FacebookTimeSpentData.java

示例9: processResponse

import com.facebook.internal.Logger; //导入方法依赖的package包/类
private void processResponse(ImageResponse response) {
    // First check if the response is for the right request. We may have:
    // 1. Sent a new request, thus super-ceding this one.
    // 2. Detached this view, in which case the response should be discarded.
    if (response.getRequest() == lastRequest) {
        lastRequest = null;
        Bitmap responseImage = response.getBitmap();
        Exception error = response.getError();
        if (error != null) {
            OnErrorListener listener = onErrorListener;
            if (listener != null) {
                listener.onError(new FacebookException(
                        "Error in downloading profile picture for profileId: " + getProfileId(), error));
            } else {
                Logger.log(LoggingBehavior.REQUESTS, Log.ERROR, TAG, error.toString());
            }
        } else if (responseImage != null) {
            setImageBitmap(responseImage);

            if (response.isCachedRedirect()) {
                sendImageRequest(false);
            }
        }
    }
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:26,代码来源:ProfilePictureView.java

示例10: createResponsesFromStream

import com.facebook.internal.Logger; //导入方法依赖的package包/类
static List<GraphResponse> createResponsesFromStream(
        InputStream stream,
        HttpURLConnection connection,
        GraphRequestBatch requests
) throws FacebookException, JSONException, IOException {

    String responseString = Utility.readStreamToString(stream);
    Logger.log(LoggingBehavior.INCLUDE_RAW_RESPONSES, RESPONSE_LOG_TAG,
            "Response (raw)\n  Size: %d\n  Response:\n%s\n", responseString.length(),
            responseString);

    return createResponsesFromString(responseString, connection, requests);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:14,代码来源:GraphResponse.java

示例11: logConversionPixel

import com.facebook.internal.Logger; //导入方法依赖的package包/类
/**
 * Deprecated. Please use {@link AppEventsLogger} instead.
 */
public void logConversionPixel(String pixelId, double valueOfPixel) {

    if (pixelId == null) {
        Logger.log(LoggingBehavior.DEVELOPER_ERRORS, "Insights", "pixelID cannot be null");
        return;
    }

    Bundle parameters = new Bundle();
    parameters.putString(EVENT_PARAMETER_PIXEL_ID, pixelId);
    parameters.putDouble(EVENT_PARAMETER_PIXEL_VALUE, valueOfPixel);

    appEventsLogger.logEvent(EVENT_NAME_LOG_CONVERSION_PIXEL, valueOfPixel, parameters);
    AppEventsLogger.eagerFlush();
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:18,代码来源:InsightsLogger.java

示例12: createResponsesFromStream

import com.facebook.internal.Logger; //导入方法依赖的package包/类
static List<Response> createResponsesFromStream(InputStream stream, HttpURLConnection connection,
        RequestBatch requests, boolean isFromCache) throws FacebookException, JSONException, IOException {

    String responseString = Utility.readStreamToString(stream);
    Logger.log(LoggingBehavior.INCLUDE_RAW_RESPONSES, RESPONSE_LOG_TAG,
            "Response (raw)\n  Size: %d\n  Response:\n%s\n", responseString.length(),
            responseString);

    return createResponsesFromString(responseString, connection, requests, isFromCache);
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:11,代码来源:Response.java

示例13: processError

import com.facebook.internal.Logger; //导入方法依赖的package包/类
@Override
protected void processError(FacebookRequestError error) {
    Logger.log(LoggingBehavior.REQUESTS,
            TAG,
            "Error getting the FB id for object '%s' with type '%s' : %s",
            objectId,
            objectType,
            error);
}
 
开发者ID:yudiandreanp,项目名称:SocioBlood,代码行数:10,代码来源:LikeActionController.java

示例14: restoreAppSessionInformation

import com.facebook.internal.Logger; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static void restoreAppSessionInformation(Context context) {
    ObjectInputStream ois = null;

    synchronized (staticLock) {
        if (!isLoaded) {
            try {
                ois =
                        new ObjectInputStream(
                                context.openFileInput(PERSISTED_SESSION_INFO_FILENAME));
                appSessionInfoMap =
                        (HashMap<AccessTokenAppIdPair, FacebookTimeSpentData>) ois.readObject();
                Logger.log(
                        LoggingBehavior.APP_EVENTS,
                        "AppEvents",
                        "App session info loaded");
            } catch (FileNotFoundException fex) {
            } catch (Exception e) {
                Log.d(TAG, "Got unexpected exception: " + e.toString());
            } finally {
                Utility.closeQuietly(ois);
                context.deleteFile(PERSISTED_SESSION_INFO_FILENAME);
                if (appSessionInfoMap == null) {
                    appSessionInfoMap =
                            new HashMap<AccessTokenAppIdPair, FacebookTimeSpentData>();
                }
                // Regardless of the outcome of the load, the session information cache
                // is always deleted. Therefore, always treat the session information cache
                // as loaded
                isLoaded = true;
                hasChanges = false;
            }
        }
    }
}
 
开发者ID:dannegm,项目名称:BrillaMXAndroid,代码行数:36,代码来源:AppEventsLogger.java

示例15: handleResponse

import com.facebook.internal.Logger; //导入方法依赖的package包/类
private static void handleResponse(
        AccessTokenAppIdPair accessTokenAppId,
        GraphRequest request,
        GraphResponse response,
        SessionEventsState sessionEventsState,
        FlushStatistics flushState) {
    FacebookRequestError error = response.getError();
    String resultDescription = "Success";

    FlushResult flushResult = FlushResult.SUCCESS;

    if (error != null) {
        final int NO_CONNECTIVITY_ERROR_CODE = -1;
        if (error.getErrorCode() == NO_CONNECTIVITY_ERROR_CODE) {
            resultDescription = "Failed: No Connectivity";
            flushResult = FlushResult.NO_CONNECTIVITY;
        } else {
            resultDescription = String.format("Failed:\n  Response: %s\n  Error %s",
                    response.toString(),
                    error.toString());
            flushResult = FlushResult.SERVER_ERROR;
        }
    }

    if (FacebookSdk.isLoggingBehaviorEnabled(LoggingBehavior.APP_EVENTS)) {
        String eventsJsonString = (String) request.getTag();
        String prettyPrintedEvents;

        try {
            JSONArray jsonArray = new JSONArray(eventsJsonString);
            prettyPrintedEvents = jsonArray.toString(2);
        } catch (JSONException exc) {
            prettyPrintedEvents = "<Can't encode events for debug logging>";
        }

        Logger.log(LoggingBehavior.APP_EVENTS, TAG,
                "Flush completed\nParams: %s\n  Result: %s\n  Events JSON: %s",
                request.getGraphObject().toString(),
                resultDescription,
                prettyPrintedEvents);
    }

    sessionEventsState.clearInFlightAndStats(error != null);

    if (flushResult == FlushResult.NO_CONNECTIVITY) {
        // We may call this for multiple requests in a batch, which is slightly inefficient
        // since in principle we could call it once for all failed requests, but the impact is
        // likely to be minimal. We don't call this for other server errors, because if an event
        // failed because it was malformed, etc., continually retrying it will cause subsequent
        // events to not be logged either.
        PersistedEvents.persistEvents(applicationContext, accessTokenAppId, sessionEventsState);
    }

    if (flushResult != FlushResult.SUCCESS) {
        // We assume that connectivity issues are more significant to report than server issues.
        if (flushState.result != FlushResult.NO_CONNECTIVITY) {
            flushState.result = flushResult;
        }
    }
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:61,代码来源:AppEventsLogger.java


注:本文中的com.facebook.internal.Logger.log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。