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

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

本文整理了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

  1. @Override
  2. public boolean isInfoEnabled() {
  3. return logger.isInfoEnabled();
  4. }

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

  1. public <T> boolean put(String k, T v) {
  2. if (v == null) {
  3. return false;
  4. }
  5. try {
  6. cache.put(new Element(k, v));
  7. return true;
  8. } catch (Exception e) {
  9. if (logger.isInfoEnabled()) {
  10. logger.info("failed to put to the local cache : %s", e.getMessage());
  11. }
  12. return false;
  13. }
  14. }

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

  1. public LocalCacheManager(String name, int max, int exptime, boolean copyOnRead, boolean copyOnWrite) {
  2. this.cache = CacheManager.getInstance().getCache(name);
  3. if (cache == null) {
  4. CacheConfiguration config =
  5. new CacheConfiguration(name, max)
  6. .copyOnRead(copyOnRead)
  7. .copyOnWrite(copyOnWrite)
  8. .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU)
  9. .eternal(false)
  10. .timeToLiveSeconds(exptime)
  11. .timeToIdleSeconds(exptime)
  12. .diskExpiryThreadIntervalSeconds(60)
  13. .persistence(new PersistenceConfiguration().strategy(PersistenceConfiguration.Strategy.NONE));
  14. this.cache = new Cache(config, null, null);
  15. CacheManager.getInstance().addCache(cache);
  16. if (logger.isInfoEnabled()) {
  17. logger.info("Arcus k/v local cache is enabled : %s", cache.toString());
  18. }
  19. }
  20. }

相关文章