org.webpieces.util.logging.Logger.isDebugEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中org.webpieces.util.logging.Logger.isDebugEnabled()方法的一些代码示例,展示了Logger.isDebugEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.isDebugEnabled()方法的具体详情如下:
包路径:org.webpieces.util.logging.Logger
类名称:Logger
方法名:isDebugEnabled

Logger.isDebugEnabled介绍

[英]Is the logger instance enabled for the DEBUG level?
[中]是否为调试级别启用了记录器实例?

代码示例

代码示例来源:origin: org.webpieces/core-util

/**
 * Log an exception (throwable) at the DEBUG level with an
 * accompanying message.
 *
 * @param msg the message accompanying the exception
 * @param t   the exception (throwable) to log
 */
public void debug(Supplier<String> msg, Throwable t) {
  if(isDebugEnabled())
    logger.debug(msg.get(), t);        
}

代码示例来源:origin: org.webpieces/core-util

/**
 * Log a message at the DEBUG level.
 *
 * Usage: log.debug(()->"my lazy log statement")
 * 
 * @param msg the message string to be logged
 */
public void debug(Supplier<String> msg) {
  if(isDebugEnabled())
    logger.debug(msg.get());
}

代码示例来源:origin: org.webpieces/http-router

public void printAllRoutes(Route route) {
    if(!log.isDebugEnabled())
      return;
    else if(route.getRouteType() != RouteType.NOT_FOUND)
      return;

    L1AllRouting routingInfo = routerBuilder.getRouterInfo();
    
    //TODO: domain specific routes
    //Collection<L2DomainRoutes> domains = routingInfo.getSpecificDomains();

    L3PrefixedRouting mainRoutes = routingInfo.getMainRoutes().getRoutesForDomain();
    mainRoutes.printRoutes(route.isHttpsRoute(), "");
  }
}

代码示例来源:origin: org.webpieces/core-statemachine

/**
 * @param smState
 * @param evt
 */
public void fireEvent(StateMachineState smState, Object evt)
{
  TransitionImpl transition = evtToTransition.get(evt);
  if(transition == null) {
    log.debug(() -> smState+"No Transition: "+getName()+" -> <no transition found>, event="+evt);
    if(noTransitionListener != null)
      noTransitionListener.noTransitionFromEvent(smState.getCurrentState(), evt);
    return;
  }
  State nextState = transition.getEndState();
  if(log.isDebugEnabled())
    log.debug(() -> smState+"Transition: "+getName()+" -> "+nextState+", event="+evt);
  try {
    smState.setCurrentState(nextState);
  } catch(RuntimeException e) {
    log.warn(smState+"Transition FAILED: "+getName()+" -> "+nextState+", event="+evt);
    throw e;
  }
}

代码示例来源:origin: org.webpieces/runtimecompile

resolveClass(applicationClass.javaClass);
if(log.isDebugEnabled()) {
  long time = System.currentTimeMillis() - start;
  log.trace(()->time+"ms to load class "+name+" from cache");

相关文章

微信公众号

最新文章

更多