org.osgl.logging.Logger类的使用及代码示例

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

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

Logger介绍

暂无

代码示例

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

private FastRequestHandler verifyBase(URL baseUrl, String baseSupplied) {
  if (null == baseUrl) {
    logger.warn("URL base not exists: " + baseSupplied);
    return AlwaysNotFound.INSTANCE;
  }
  return null;
}

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

private void compileSources() {
  long l = 0;
  if (logger.isDebugEnabled()) {
    logger.debug("Source compiling starts ...");
    l = $.ms();
  }
  Collection<Source> toBeCompiled = sources.values();
  compiler.compile(toBeCompiled);
  if (logger.isDebugEnabled()) {
    logger.debug("Source compiling takes %sms to compile %s sources", $.ms() - l, toBeCompiled.size());
  }
}

代码示例来源: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

@Command(name = "act.log.level.show", help = "Show log level")
public String showLogLevel(@Required("specify LOGGER name") String name) {
  Logger logger = LogManager.get(name);
  if (logger.isTraceEnabled()) {
    return "trace";
  } else if (logger.isDebugEnabled()) {
    return "debug";
  } else if (logger.isInfoEnabled()) {
    return "info";
  } else if (logger.isWarnEnabled()) {
    return "warn";
  } else if (logger.isErrorEnabled()) {
    return "error";
  }
  return "fatal";
}

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

private static void initViewManager() {
  LOGGER.debug("initializing view manager ...");
  viewManager = new ViewManager();
}

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

public boolean send() {
  try {
    MimeMessage message = createMessage();
    if (!mailerConfig().mock()) {
      if (logger.isDebugEnabled()) {
        logger.debug("Sending email\n%sEnd email\n", debug(message));
      }
      Transport.send(message);
    } else {
      logger.info("Sending email\n%sEnd email\n", debug(message));
    }
    return true;
  } catch (Exception e) {
    logger.error(e, "Error sending email: %s", this);
    return false;
  }
}

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

@Override
public void register() {
  if (!load()) {
    Act.LOGGER.warn("Scanner plugin cannot be loaded: " + getClass().getName());
    return;
  }
  Act.scannerPluginManager().register(this);
  Act.LOGGER.debug("Plugin registered: %s", getClass().getName());
}

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

@Override
public void error(String msg) {
  logger.error(msg);
}

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

@Override
protected void releaseResources() {
  LOGGER.trace("release job manager resources");
  for (Job job : jobs.values()) {
    job.destroy();
  }
  jobs.clear();
  executor.getQueue().clear();
  executor.shutdownNow();
}

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

private void checkAndCommit() {
    if (!enabled) {
      logger.info("Global CSRF is disabled");
      conf.enableCsrf(false);
    }
    logger.info("Global CSRF is enabled");
    conf.csrfCookieName(this.cookieName);
    conf.csrfHeaderName(this.headerName);
    conf.csrfParamName(this.paramName);
    conf.csrfProtector(this.protector);
  }
}

代码示例来源: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

protected boolean isDebugEnabled() {
  return logger.isDebugEnabled();
}

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

static void initEnhancerManager() {
  LOGGER.debug("initializing byte code enhancer manager ...");
  enhancerManager = new BytecodeEnhancerManager();
}

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

public boolean send() {
  try {
    MimeMessage message = createMessage();
    if (!mailerConfig().mock()) {
      if (logger.isDebugEnabled()) {
        logger.debug("Sending email\n%sEnd email\n", debug(message));
      }
      Transport.send(message);
    } else {
      logger.info("Sending email\n%sEnd email\n", debug(message));
    }
    return true;
  } catch (Exception e) {
    logger.error(e, "Error sending email: %s", this);
    return false;
  }
}

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

@Override
public void register() {
  if (!load()) {
    Act.LOGGER.warn("Scanner plugin cannot be loaded: " + getClass().getName());
    return;
  }
  Act.scannerPluginManager().register(this);
  Act.LOGGER.debug("Plugin registered: %s", getClass().getName());
}

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

@Command(name = "act.log.level.show", help = "Show log level")
public String showLogLevel(@Required("specify LOGGER name") String name) {
  Logger logger = LogManager.get(name);
  if (logger.isTraceEnabled()) {
    return "trace";
  } else if (logger.isDebugEnabled()) {
    return "debug";
  } else if (logger.isInfoEnabled()) {
    return "info";
  } else if (logger.isWarnEnabled()) {
    return "warn";
  } else if (logger.isErrorEnabled()) {
    return "error";
  }
  return "fatal";
}

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

@Override
public void error(String msg, Throwable t) {
  logger.error(t, msg);
}

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

@Override
public void onTimerStop(Timer timer) {
  String name = timer.name();
  long ns = timer.ns();
  logger(name).trace("Timer[%s] stopped. Time elapsed: %sns", name, ns);
  onTimerStop_(name, ns);
}

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

private void checkAndCommit() {
    if (!enabled) {
      logger.info("Global CSRF is disabled");
      conf.enableCsrf(false);
    }
    logger.info("Global CSRF is enabled");
    conf.csrfCookieName(this.cookieName);
    conf.csrfHeaderName(this.headerName);
    conf.csrfParamName(this.paramName);
    conf.csrfProtector(this.protector);
  }
}

代码示例来源: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;
}

相关文章