net.spy.memcached.compat.log.Logger.isInfoEnabled()方法的使用及代码示例

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

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

Logger.isInfoEnabled介绍

[英]True if info is enabled for this logger.
[中]如果已为此记录器启用信息,则为True。

代码示例

代码示例来源:origin: com.couchbase.client/couchbase-client

@Override
public boolean isInfoEnabled() {
 return logger.isInfoEnabled();
}

代码示例来源:origin: naver/arcus-java-client

public <T> boolean put(String k, T v) {
 if (v == null) {
  return false;
 }
 try {
  cache.put(new Element(k, v));
  return true;
 } catch (Exception e) {
  if (logger.isInfoEnabled()) {
   logger.info("failed to put to the local cache : %s", e.getMessage());
  }
  return false;
 }
}

代码示例来源:origin: naver/arcus-java-client

public LocalCacheManager(String name, int max, int exptime, boolean copyOnRead, boolean copyOnWrite) {
 this.cache = CacheManager.getInstance().getCache(name);
 if (cache == null) {
  CacheConfiguration config =
      new CacheConfiguration(name, max)
          .copyOnRead(copyOnRead)
          .copyOnWrite(copyOnWrite)
          .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU)
          .eternal(false)
          .timeToLiveSeconds(exptime)
          .timeToIdleSeconds(exptime)
          .diskExpiryThreadIntervalSeconds(60)
          .persistence(new PersistenceConfiguration().strategy(PersistenceConfiguration.Strategy.NONE));
  this.cache = new Cache(config, null, null);
  CacheManager.getInstance().addCache(cache);
  if (logger.isInfoEnabled()) {
   logger.info("Arcus k/v local cache is enabled : %s", cache.toString());
  }
 }
}

相关文章