Tabnine Logo
Logger.isDebugEnabled
Code IndexAdd Tabnine to your IDE (free)

How to use
isDebugEnabled
method
in
org.slf4j.Logger

Best Java code snippets using org.slf4j.Logger.isDebugEnabled (Showing top 20 results out of 42,921)

Refine searchRefine arrow

  • Logger.debug
  • Logger.error
  • Logger.warn
  • Logger.info
  • List.size
  • List.add
  • List.get
origin: spring-projects/spring-framework

public void debug(Object message) {
  if (message instanceof String || this.logger.isDebugEnabled()) {
    this.logger.debug(String.valueOf(message));
  }
}
origin: skylot/jadx

  public void printMissingClasses() {
    int count = missingClasses.size();
    if (count == 0) {
      return;
    }
    LOG.warn("Found {} references to unknown classes", count);
    if (LOG.isDebugEnabled()) {
      List<String> clsNames = new ArrayList<>(missingClasses);
      Collections.sort(clsNames);
      for (String cls : clsNames) {
        LOG.debug("  {}", cls);
      }
    }
  }
}
origin: apache/hive

static void logException(String msg, Exception e) {
 if (LOG.isDebugEnabled()) {
  LOG.debug(msg, e);
 } else {
  LOG.info(msg + ": " + e.getMessage());
 }
}
origin: apache/hive

private void addCredentials(ReduceWork reduceWork, DAG dag) {
 Set<URI> fileSinkUris = new HashSet<URI>();
 List<Node> topNodes = new ArrayList<Node>();
 topNodes.add(reduceWork.getReducer());
 collectFileSinkUris(topNodes, fileSinkUris);
 if (LOG.isDebugEnabled()) {
  for (URI fileSinkUri: fileSinkUris) {
   LOG.debug("Marking ReduceWork output URI as needing credentials: " + fileSinkUri);
  }
 }
 dag.addURIsForCredentials(fileSinkUris);
}
origin: apache/hbase

 private void stopUsingCurrentWriter() {
  if (currentWriter != null) {
   if (LOG.isDebugEnabled()) {
    LOG.debug("Stopping to use a writer after [" + Bytes.toString(currentWriterEndKey)
      + "] row; wrote out " + cellsInCurrentWriter + " kvs");
   }
   cellsInCurrentWriter = 0;
  }
  currentWriter = null;
  currentWriterEndKey =
    (existingWriters.size() + 1 == boundaries.size()) ? null : boundaries.get(existingWriters
      .size() + 1);
 }
}
origin: alibaba/fescar

  private void printMergeMessageLog(MergedWarpMessage mergeMessage) {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("merge msg size:" + mergeMessage.msgIds.size());
      for (AbstractMessage cm : mergeMessage.msgs) { LOGGER.debug(cm.toString()); }
      StringBuffer sb = new StringBuffer();
      for (long l : mergeMessage.msgIds) { sb.append(MSG_ID_PREFIX).append(l).append(SINGLE_LOG_POSTFIX); }
      sb.append("\n");
      for (long l : futures.keySet()) { sb.append(FUTURES_PREFIX).append(l).append(SINGLE_LOG_POSTFIX); }
      LOGGER.debug(sb.toString());
    }
  }
}
origin: alibaba/fescar

@Override
public void onCheckMessage(long msgId, ChannelHandlerContext ctx, ServerMessageSender sender) {
  try {
    sender.sendResponse(msgId, ctx.channel(), HeartbeatMessage.PONG);
  } catch (Throwable throwable) {
    LOGGER.error("", "send response error", throwable);
  }
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("received PING from " + ctx.channel().remoteAddress());
  }
}
origin: apache/flink

@Override
public void initializeState(StateInitializationContext context) throws Exception {
  super.initializeState(context);
  checkState(checkpointedState == null,    "The reader state has already been initialized.");
  checkpointedState = context.getOperatorStateStore().getSerializableListState("splits");
  int subtaskIdx = getRuntimeContext().getIndexOfThisSubtask();
  if (context.isRestored()) {
    LOG.info("Restoring state for the {} (taskIdx={}).", getClass().getSimpleName(), subtaskIdx);
    // this may not be null in case we migrate from a previous Flink version.
    if (restoredReaderState == null) {
      restoredReaderState = new ArrayList<>();
      for (TimestampedFileInputSplit split : checkpointedState.get()) {
        restoredReaderState.add(split);
      }
      if (LOG.isDebugEnabled()) {
        LOG.debug("{} (taskIdx={}) restored {}.", getClass().getSimpleName(), subtaskIdx, restoredReaderState);
      }
    }
  } else {
    LOG.info("No state to restore for the {} (taskIdx={}).", getClass().getSimpleName(), subtaskIdx);
  }
}
origin: apache/pulsar

@Override
protected void handleGetTopicsOfNamespaceSuccess(CommandGetTopicsOfNamespaceResponse success) {
  checkArgument(state == State.Ready);
  long requestId = success.getRequestId();
  List<String> topics = success.getTopicsList();
  if (log.isDebugEnabled()) {
    log.debug("{} Received get topics of namespace success response from server: {} - topics.size: {}",
      ctx.channel(), success.getRequestId(), topics.size());
  }
  CompletableFuture<List<String>> requestFuture = pendingGetTopicsRequests.remove(requestId);
  if (requestFuture != null) {
    requestFuture.complete(topics);
  } else {
    log.warn("{} Received unknown request id from server: {}", ctx.channel(), success.getRequestId());
  }
}
origin: apache/flink

@Override
public void initializeState(FunctionInitializationContext context) throws Exception {
  Preconditions.checkArgument(this.restoredBucketStates == null,
    "The " + getClass().getSimpleName() + " has already been initialized.");
  try {
    initFileSystem();
  } catch (IOException e) {
    LOG.error("Error while creating FileSystem when initializing the state of the RollingSink.", e);
    throw new RuntimeException("Error while creating FileSystem when initializing the state of the RollingSink.", e);
  }
  if (this.refTruncate == null) {
    this.refTruncate = reflectTruncate(fs);
  }
  OperatorStateStore stateStore = context.getOperatorStateStore();
  restoredBucketStates = stateStore.getSerializableListState("rolling-states");
  int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask();
  if (context.isRestored()) {
    LOG.info("Restoring state for the {} (taskIdx={}).", getClass().getSimpleName(), subtaskIndex);
    for (BucketState bucketState : restoredBucketStates.get()) {
      handleRestoredBucketState(bucketState);
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("{} (taskIdx= {}) restored {}", getClass().getSimpleName(), subtaskIndex, bucketState);
    }
  } else {
    LOG.info("No state to restore for the {} (taskIdx= {}).", getClass().getSimpleName(), subtaskIndex);
  }
}
origin: apache/geode

@Override
protected void rebalanceCache() {
 try {
  getLogger().info("Rebalancing: " + this.cache);
  RebalanceResults results = RegionHelper.rebalanceCache(this.cache);
  if (getLogger().isDebugEnabled()) {
   getLogger().debug("Done rebalancing: " + this.cache);
   getLogger().debug(RegionHelper.getRebalanceResultsMessage(results));
  }
 } catch (Exception e) {
  getLogger().warn("Rebalance failed because of the following exception:", e);
 }
}
origin: resilience4j/resilience4j

@Override
public void onSubscribe(Subscription s) {
  if (LOG.isDebugEnabled()) {
    LOG.info("onSubscribe");
  }
  sa.setSubscription(s);
}
origin: apache/nifi

void expire(final FlowFile flowFile, final String details) {
  try {
    final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.EXPIRE).setDetails(details).build();
    events.add(record);
  } catch (final Exception e) {
    logger.error("Failed to generate Provenance Event due to " + e);
    if (logger.isDebugEnabled()) {
      logger.error("", e);
    }
  }
}
origin: apache/kafka

/**
 * Queue a call for sending.
 *
 * If the AdminClient thread has exited, this will fail. Otherwise, it will succeed (even
 * if the AdminClient is shutting down). This function should called when retrying an
 * existing call.
 *
 * @param call      The new call object.
 * @param now       The current time in milliseconds.
 */
void enqueue(Call call, long now) {
  if (log.isDebugEnabled()) {
    log.debug("Queueing {} with a timeout {} ms from now.", call, call.deadlineMs - now);
  }
  boolean accepted = false;
  synchronized (this) {
    if (newCalls != null) {
      newCalls.add(call);
      accepted = true;
    }
  }
  if (accepted) {
    client.wakeup(); // wake the thread if it is in poll()
  } else {
    log.debug("The AdminClient thread has exited. Timing out {}.", call);
    call.fail(Long.MAX_VALUE, new TimeoutException("The AdminClient thread has exited."));
  }
}
origin: apache/hive

private static boolean[] pickStripesInternal(SearchArgument sarg, int[] filterColumns,
  List<StripeStatistics> stripeStats, int stripeCount, Path filePath,
  final SchemaEvolution evolution) {
 boolean[] includeStripe = new boolean[stripeCount];
 for (int i = 0; i < includeStripe.length; ++i) {
  includeStripe[i] = (i >= stripeStats.size()) ||
    isStripeSatisfyPredicate(stripeStats.get(i), sarg, filterColumns, evolution);
  if (LOG.isDebugEnabled() && !includeStripe[i]) {
   LOG.debug("Eliminating ORC stripe-" + i + " of file '" + filePath
     + "'  as it did not satisfy predicate condition.");
  }
 }
 return includeStripe;
}
origin: apache/flink

  @Override
  public InputSplit getNextInputSplit(String host, int taskId) {
    InputSplit next = null;
    
    // keep the synchronized part short
    synchronized (this.splits) {
      if (this.splits.size() > 0) {
        next = this.splits.remove(this.splits.size() - 1);
      }
    }
    
    if (LOG.isDebugEnabled()) {
      if (next == null) {
        LOG.debug("No more input splits available");
      } else {
        LOG.debug("Assigning split " + next + " to " + host);
      }
    }
    return next;
  }
}
origin: micronaut-projects/micronaut-core

private void logException(Throwable cause) {
  //handling connection reset by peer exceptions
  if (cause instanceof IOException && IGNORABLE_ERROR_MESSAGE.matcher(cause.getMessage()).matches()) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Swallowed an IOException caused by client connectivity: " + cause.getMessage(), cause);
    }
  } else {
    if (LOG.isErrorEnabled()) {
      LOG.error("Unexpected error occurred: " + cause.getMessage(), cause);
    }
  }
}
origin: apache/nifi

@Override
public Response toResponse(NoConnectedNodesException ex) {
  // log the error
  logger.info(String.format("Cluster failed processing request: %s. Returning %s response.", ex, Response.Status.INTERNAL_SERVER_ERROR));
  if (logger.isDebugEnabled()) {
    logger.debug(StringUtils.EMPTY, ex);
  }
  return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("Action was performed, but no nodes are connected.").type("text/plain").build();
}
origin: perwendel/spark

/**
 * Trigger a browser redirect
 *
 * @param location Where to redirect
 */
public void redirect(String location) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("Redirecting ({} {} to {}", "Found", HttpServletResponse.SC_FOUND, location);
  }
  try {
    response.sendRedirect(location);
  } catch (IOException ioException) {
    LOG.warn("Redirect failure", ioException);
  }
}
origin: spring-projects/spring-framework

public void debug(Object message, Throwable exception) {
  if (message instanceof String || this.logger.isDebugEnabled()) {
    this.logger.debug(String.valueOf(message), exception);
  }
}
org.slf4jLoggerisDebugEnabled

Javadoc

Is the logger instance enabled for the DEBUG level?

Popular methods of Logger

  • info
    This method is similar to #info(String,Object[])method except that the marker data is also taken int
  • error
    This method is similar to #error(String,Object[])method except that the marker data is also taken in
  • debug
    This method is similar to #debug(String,Object[])method except that the marker data is also taken in
  • warn
    This method is similar to #warn(String,Object[])method except that the marker data is also taken int
  • trace
    This method is similar to #trace(String,Object...)method except that the marker data is also taken i
  • isTraceEnabled
    Similar to #isTraceEnabled() method except that the marker data is also taken into account.
  • isInfoEnabled
    Similar to #isInfoEnabled() method except that the marker data is also taken into consideration.
  • isWarnEnabled
    Similar to #isWarnEnabled() method except that the marker data is also taken into consideration.
  • isErrorEnabled
    Similar to #isErrorEnabled() method except that the marker data is also taken into consideration.
  • getName
    Return the name of this Logger instance.

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • getSupportFragmentManager (FragmentActivity)
  • requestLocationUpdates (LocationManager)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • BoxLayout (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now