APISonar


com.facebook.buck.util.network.RemoteLogger.log

> com > facebook > buck > util > network > RemoteLogger > log
com APIs facebook APIs buck APIs util APIs network APIs RemoteLogger APIs log APIs

Example 1
private final RemoteLogger remoteLogger;

  private void putInSink(BuildId buildId, Object object) {
    if (failureCount.get() > MAX_FAILURE_COUNT) {
      return;
    }
    sentEventsCount++;

    ObjectNode jsonNode = mapper.valueToTree(object);
    jsonNode.put("@class", object.getClass().getCanonicalName());
    jsonNode.put("buildId", buildId.toString());

    Optional<ListenableFuture<Void>> upload = remoteLogger.log(jsonNode.toString());
    if (upload.isPresent()) {
      registerPendingUpload(upload.get());
    }
  }
Example 2
private final RemoteLogger logger;

  public void onHttpArtifactCacheEvent(HttpArtifactCacheEvent.Finished event) {
    final String buildIdString = event.getBuildId().toString();
    ObjectNode jsonNode = jsonConverter.valueToTree(event);
    if (!environmentInfo.isEmpty()) {
      jsonNode.put("environment",  jsonConverter.valueToTree(environmentInfo));
    }

    String hiveRow = HiveRowFormatter.newFormatter()
        .appendString(jsonNode.toString())
        .appendString(buildIdString)
        .build();
    logger.log(hiveRow);
  }