org.osgl.logging.Logger.isTraceEnabled()方法的使用及代码示例

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

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

Logger.isTraceEnabled介绍

暂无

代码示例

代码示例来源:origin: actframework/actframework

protected static boolean isTraceEnabled() {
  return LOGGER.isTraceEnabled();
}

代码示例来源:origin: org.actframework/act-jpa-common

public static void close() {
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("JPA context close");
  }
  JPAContext cur = cur_.get();
  if (null != cur) {
    cur.destroy();
    cur_.remove();
  }
}

代码示例来源:origin: actframework/actframework

@Override
public Metric metric(String name) {
  if (!Act.appConfig().metricEnabled()) {
    return Metric.NULL_METRIC;
  }
  Logger logger = enabledMap.get(name);
  if (null == logger) {
    logger = LogManager.get("metric." + name);
    enabledMap.put(name, logger);
  }
  return logger.isTraceEnabled() ? metric() : Metric.NULL_METRIC;
}

代码示例来源:origin: actframework/actframework

public <T> Future<T> on(DateTime instant, Callable<T> callable) {
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("schedule callable[%s] on %s", callable, instant);
  }
  DateTime now = DateTime.now();
  E.illegalArgumentIf(instant.isBefore(now));
  Seconds seconds = Seconds.secondsBetween(now, instant);
  return executor().schedule(callable, seconds.getSeconds(), TimeUnit.SECONDS);
}

代码示例来源:origin: org.actframework/act

@Override
public Metric metric(String name) {
  if (!Act.appConfig().metricEnabled()) {
    return Metric.NULL_METRIC;
  }
  Logger logger = enabledMap.get(name);
  if (null == logger) {
    logger = LogManager.get("metric." + name);
    enabledMap.put(name, logger);
  }
  return logger.isTraceEnabled() ? metric() : Metric.NULL_METRIC;
}

代码示例来源:origin: org.actframework/act-jpa-common

public static void initForJob() {
  if (null != ActionContext.current()) {
    return;
  }
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("JPA context init for job");
  }
  E.illegalStateIf(null != cur_.get(), "JPAContext already set");
  JPAContext ctx = new JPAContext();
  ctx.initForJob = true;
  cur_.set(ctx);
}

代码示例来源:origin: org.actframework/act

public <T> Future<T> on(DateTime instant, Callable<T> callable) {
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("schedule callable[%s] on %s", callable, instant);
  }
  DateTime now = DateTime.now();
  E.illegalArgumentIf(instant.isBefore(now));
  Seconds seconds = Seconds.secondsBetween(now, instant);
  return executor().schedule(callable, seconds.getSeconds(), TimeUnit.SECONDS);
}

代码示例来源:origin: actframework/actframework

public HandlerEnhancer(final MethodVisitor mv, HandlerMethodMetaInfo meta, final int access, final String name, final String desc, final String signature, final String[] exceptions) {
  super(ASM5, new MethodNode(access, name, desc, signature, exceptions));
  if (logger.isTraceEnabled()) {
    logger.trace("enhance handler: " + meta.fullName());
  }
  this.info = meta;
  this.next = mv;
}

代码示例来源:origin: actframework/actframework

final void register(Job job, JobManager manager) {
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("trigger on [%s]: %s", this, job);
  }
  job.trigger(this);
  schedule(manager, job);
}

代码示例来源:origin: actframework/actframework

public void on(DateTime instant, Runnable runnable) {
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("schedule runnable[%s] on %s", runnable, instant);
  }
  DateTime now = DateTime.now();
  E.illegalArgumentIf(instant.isBefore(now));
  Seconds seconds = Seconds.secondsBetween(now, instant);
  executor().schedule(wrap(runnable), seconds.getSeconds(), TimeUnit.SECONDS);
}

代码示例来源:origin: actframework/actframework

private void sendToConnections(String message, WebSocketConnectionRegistry registry, String key) {
    for (WebSocketConnection conn : registry.get(key)) {
      if (logger.isTraceEnabled()) {
        logger.trace("send to websocket connection by key: %s", key);
      }
      conn.send(message);
    }
  }
}

代码示例来源:origin: org.actframework/act

public HandlerEnhancer(final MethodVisitor mv, HandlerMethodMetaInfo meta, final int access, final String name, final String desc, final String signature, final String[] exceptions) {
  super(ASM5, new MethodNode(access, name, desc, signature, exceptions));
  if (logger.isTraceEnabled()) {
    logger.trace("enhance handler: " + meta.fullName());
  }
  this.info = meta;
  this.next = mv;
}

代码示例来源:origin: org.actframework/act

public void on(DateTime instant, Runnable runnable) {
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("schedule runnable[%s] on %s", runnable, instant);
  }
  DateTime now = DateTime.now();
  E.illegalArgumentIf(instant.isBefore(now));
  Seconds seconds = Seconds.secondsBetween(now, instant);
  executor().schedule(wrap(runnable), seconds.getSeconds(), TimeUnit.SECONDS);
}

代码示例来源:origin: org.actframework/act

private void sendToConnections(String message, WebSocketConnectionRegistry registry, String key) {
    for (WebSocketConnection conn : registry.get(key)) {
      if (logger.isTraceEnabled()) {
        logger.trace("send to websocket connection by key: %s", key);
      }
      conn.send(message);
    }
  }
}

代码示例来源:origin: org.actframework/act-jpa-common

public static void init() {
  if (LOGGER.isTraceEnabled()) {
    ActionContext ctx = ActionContext.current();
    if (null == ctx) {
      LOGGER.trace("JPA context init");
    } else {
      LOGGER.trace("JPA context init - " + ctx.req());
    }
  }
  E.illegalStateIf(null != cur_.get(), "JPAContext already set");
  cur_.set(new JPAContext());
}

代码示例来源:origin: actframework/actframework

private static void registerSingleton(Class<?> cls) {
  E.invalidConfigurationIf(stopInheritedScope(cls), "@Stateful or @StopInheritedScope annotation cannot be apply on singleton or @Stateless annotated class");
  Object instance = tryLoadAppService(cls);
  if (null != instance) {
    Act.app().registerSingleton(instance);
  } else if (null == cls.getAnnotation(Lazy.class)) {
    App.instance().registerSingletonClass(cls);
    if (LOGGER.isTraceEnabled()) {
      LOGGER.trace("register singleton: %s", cls);
    }
  } else if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("skip lazy singleton registration for %s", cls);
  }
}

代码示例来源:origin: actframework/actframework

public void scheduleFind() {
  if (logger.isTraceEnabled()) {
    logger.trace("schedule class finding for %s", this);
  }
  final App app = App.instance();
  app.jobManager().on(when, jobId(), new Runnable() {
    @Override
    public void run() {
      how.find(app, ClassFinderData.this);
    }
  });
}

代码示例来源:origin: org.actframework/act

public void scheduleFind() {
  if (logger.isTraceEnabled()) {
    logger.trace("schedule class finding for %s", this);
  }
  final App app = App.instance();
  app.jobManager().on(when, jobId(), new Runnable() {
    @Override
    public void run() {
      how.find(app, ClassFinderData.this);
    }
  });
}

代码示例来源:origin: actframework/actframework

private void initExecutor(App app) {
  int poolSize = app.config().jobPoolSize();
  executor = new ScheduledThreadPoolExecutor(poolSize, new AppThreadFactory("jobs"), new ThreadPoolExecutor.AbortPolicy());
  executor.setRemoveOnCancelPolicy(true);
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("init executor with thread pool: %s", poolSize);
  }
}

代码示例来源:origin: org.actframework/act

private void initExecutor(App app) {
  int poolSize = app.config().jobPoolSize();
  executor = new ScheduledThreadPoolExecutor(poolSize, new AppThreadFactory("jobs"), new ThreadPoolExecutor.AbortPolicy());
  executor.setRemoveOnCancelPolicy(true);
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("init executor with thread pool: %s", poolSize);
  }
}

相关文章