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

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

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

Logger.warn介绍

暂无

代码示例

代码示例来源: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 static <T> T newInstance(String key, Class c, Class<T> expectedClass) {
  if (!expectedClass.isAssignableFrom(c)) {
    logger.warn("Mismatched type found for configuration %s", key);
    return null;
  }
  try {
    return (T) c.newInstance();
  } catch (Exception e) {
    logger.warn(e, "Cannot create new instance for configuration %s", key);
    return null;
  }
}

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

private boolean trySetUpClient(NetworkHandler client, int port, boolean secure) {
  try {
    setUpClient(client, port, secure);
    return true;
  } catch (IOException e) {
    logger.warn(e, "Cannot set up %s to port %s:", client, port);
    return false;
  }
}

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

public int resourcePreloadSizeLimit() {
  if (null == resourcePreloadSizeLimit) {
    resourcePreloadSizeLimit = get(RESOURCE_PRELOAD_SIZE_LIMIT, 1024 * 10);
    if (resourcePreloadSizeLimit <= 0) {
      logger.warn("resource.preload.size.limit is set to zero or below, resource preload is disabled!");
    }
  }
  return resourcePreloadSizeLimit;
}

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

public String secret() {
  if (null == secret) {
    secret = get(AppConfigKey.SECRET, "myawesomeapp");
    if ("myawesomeapp".equals(secret)) {
      logger.warn("Application secret key not set! You are in the dangerous zone!!!");
    }
  }
  return secret;
}

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

public static ClassInfoRepository classInfoRepository() {
  ClassLoader cl = Act.class.getClassLoader();
  if (cl instanceof BootstrapClassLoader) {
    return ((BootstrapClassLoader) cl).classInfoRepository();
  } else {
    LOGGER.warn("Class loader [%s] of Act is not a ActClassLoader", cl);
    return null;
  }
}

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

private static void clearPidFile() {
  String pidFile = pidFile();
  try {
    File file = new File(pidFile);
    if (!file.delete()) {
      file.deleteOnExit();
    }
  } catch (Exception e) {
    LOGGER.warn(e, "Error delete pid file: %s", pidFile);
  }
}

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

private boolean trySetUpClient(NetworkHandler client, int port, boolean secure) {
  try {
    setUpClient(client, port, secure);
    return true;
  } catch (IOException e) {
    logger.warn(e, "Cannot set up %s to port %s:", client, port);
    return false;
  }
}

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

private <T extends AppCodeScanner> void _register(T scanner, List<T> scanners) {
  scanner.setApp(app());
  if (scanners.contains(scanner)) {
    logger.warn("%s has already been registered", scanner);
    return;
  }
  scanners.add(scanner);
}

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

public static List<Class<?>> pluginClasses() {
  ClassLoader cl = Act.class.getClassLoader();
  if (cl instanceof PluginClassProvider) {
    return ((PluginClassProvider) cl).pluginClasses();
  } else {
    LOGGER.warn("Class loader [%s] of Act is not a PluginClassProvider", cl);
    return C.list();
  }
}

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

public void setJobProgressGauge(String jobId, ProgressGauge progressGauge) {
  Job job = jobById(jobId);
  if (null == job) {
    LOGGER.warn("cannot find job by Id: " + jobId);
  } else {
    job.setProgressGauge(progressGauge);
  }
}

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

protected static Object _load(String resourcePath, BeanSpec spec, Object hint, boolean ignoreResourceNotFound) {
  URL url = loadResource(resourcePath);
  if (null == url) {
    if (!ignoreResourceNotFound) {
      LOGGER.warn("resource not found: " + resourcePath);
    }
    return null;
  }
  return _load(url, spec, hint);
}

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

@Override
  public RequestHandler resolve(String base, App app, EnumSet<BuiltInHandlerDecorator> decorators) {
    File file = new File(base);
    if (!file.canRead()) {
      LOGGER.warn("External file not found: %s", file.getPath());
    }
    return decorators.contains(BuiltInHandlerDecorator.authenticated) ?
        new ContextualHandler(new AuthenticatedFileGetter(file)) :
        new FileGetter(file);
  }
},

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

private static void addTokenToList(List<String> list, S.Buffer token) {
  String s = token.toString();
  if (S.notEmpty(s)) {
    list.add(s);
  } else {
    LOGGER.warn("empty index encountered");
  }
  token.delete(0, s.length() + 1);
}

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

public MailerContext from(String from) {
  E.illegalArgumentIf(S.empty(from), "<from> cannot be empty");
  List<InternetAddress> l = canonicalRecipients(null, from);
  E.illegalArgumentIf(l.isEmpty(), "from address expected");
  if (l.size() > 1) {
    logger.warn("There are more than one email address specified, only the first one will be used as From address");
  }
  this.from = l.get(0);
  return this;
}

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

private void buildIndex() {
  libBC.putAll(Jars.buildClassNameIndex(lib));
  pluginBC.putAll(Jars.buildClassNameIndex(plugin));
  File actJar = Jars.probeJarFile(Act.class);
  if (null == actJar) {
    logger.warn("Cannot find jar file for Act");
  } else {
    pluginBC.putAll(Jars.buildClassNameIndex(C.list(actJar)));
  }
}

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

@Override
  public void on(DependencyInjectionBinder event) throws Exception {
    DependencyInjector injector = app().injector();
    if (null == injector) {
      LOGGER.warn("Dependency injector not found");
    } else {
      injector.registerDiBinder(event);
    }
  }
});

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

@Override
void schedule(JobManager manager, Job job) {
  traceSchedule(job);
  Job associateTarget = manager.jobById(targetId, false);
  if (null == associateTarget) {
    LOGGER.warn("Failed to register job because target job not found: %s. Will try again after app started", targetId);
    scheduleDelayedRegister(manager, job);
  } else {
    associate(job, associateTarget);
  }
}

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

@SuppressWarnings("unchecked")
private boolean callNowIfEmitted(SysEventId sysEventId, SysEventListener l) {
  if (app().eventEmitted(sysEventId)) {
    try {
      l.on(lookUpSysEvent(sysEventId));
    } catch (Exception e) {
      LOGGER.warn(e, "error calling event handler on " + sysEventId);
    }
    return true;
  }
  return false;
}

相关文章