io.airlift.log.Logger.isDebugEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(11.7k)|赞(0)|评价(0)|浏览(244)

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

Logger.isDebugEnabled介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

private static Configuration createConfiguration(String principal, String keytabLocation)
  {
    ImmutableMap.Builder<String, String> optionsBuilder = ImmutableMap.<String, String>builder()
        .put("useKeyTab", "true")
        .put("storeKey", "true")
        .put("doNotPrompt", "true")
        .put("isInitiator", "true")
        .put("principal", principal)
        .put("keyTab", keytabLocation);

    if (log.isDebugEnabled()) {
      optionsBuilder.put("debug", "true");
    }

    Map<String, String> options = optionsBuilder.build();

    return new Configuration()
    {
      @Override
      public AppConfigurationEntry[] getAppConfigurationEntry(String name)
      {
        return new AppConfigurationEntry[] {
            new AppConfigurationEntry(
                KERBEROS_LOGIN_MODULE,
                AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,
                options)};
      }
    };
  }
}

代码示例来源:origin: prestodb/presto

@Override
  public AppConfigurationEntry[] getAppConfigurationEntry(String name)
  {
    Map<String, String> options = new HashMap<>();
    options.put("refreshKrb5Config", "true");
    options.put("doNotPrompt", "true");
    if (LOG.isDebugEnabled()) {
      options.put("debug", "true");
    }
    if (config.getKeytab() != null) {
      options.put("keyTab", config.getKeytab().getAbsolutePath());
    }
    options.put("isInitiator", "false");
    options.put("useKeyTab", "true");
    options.put("principal", servicePrincipal);
    options.put("storeKey", "true");
    return new AppConfigurationEntry[] {new AppConfigurationEntry(Krb5LoginModule.class.getName(), REQUIRED, options)};
  }
});

代码示例来源:origin: prestodb/presto

if (log.isDebugEnabled()) {
  upload.addProgressListener(createProgressListener(upload));

代码示例来源:origin: airlift/airship

@Override
  public void onFailure(Throwable t)
  {
    if (serviceInventoryUp.compareAndSet(true, false) && !log.isDebugEnabled()) {
      log.error("Unable to post service inventory to agent at %s: %s", internalUri, t.getMessage());
    }
    log.debug(t, "Unable to post service inventory to agent at %s: %s", internalUri, t.getMessage());
  }
});

代码示例来源:origin: prestosql/presto

@Override
  public AppConfigurationEntry[] getAppConfigurationEntry(String name)
  {
    Map<String, String> options = new HashMap<>();
    options.put("refreshKrb5Config", "true");
    options.put("doNotPrompt", "true");
    if (LOG.isDebugEnabled()) {
      options.put("debug", "true");
    }
    if (config.getKeytab() != null) {
      options.put("keyTab", config.getKeytab().getAbsolutePath());
    }
    options.put("isInitiator", "false");
    options.put("useKeyTab", "true");
    options.put("principal", servicePrincipal);
    options.put("storeKey", "true");
    return new AppConfigurationEntry[] {new AppConfigurationEntry(Krb5LoginModule.class.getName(), REQUIRED, options)};
  }
});

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

@Override
  public AppConfigurationEntry[] getAppConfigurationEntry(String name)
  {
    Map<String, String> options = new HashMap<>();
    options.put("refreshKrb5Config", "true");
    options.put("doNotPrompt", "true");
    if (LOG.isDebugEnabled()) {
      options.put("debug", "true");
    }
    if (config.getKeytab() != null) {
      options.put("keyTab", config.getKeytab().getAbsolutePath());
    }
    options.put("isInitiator", "false");
    options.put("useKeyTab", "true");
    options.put("principal", servicePrincipal);
    options.put("storeKey", "true");
    return new AppConfigurationEntry[] {new AppConfigurationEntry(Krb5LoginModule.class.getName(), REQUIRED, options)};
  }
});

代码示例来源:origin: io.prestosql/presto-main

@Override
  public AppConfigurationEntry[] getAppConfigurationEntry(String name)
  {
    Map<String, String> options = new HashMap<>();
    options.put("refreshKrb5Config", "true");
    options.put("doNotPrompt", "true");
    if (LOG.isDebugEnabled()) {
      options.put("debug", "true");
    }
    if (config.getKeytab() != null) {
      options.put("keyTab", config.getKeytab().getAbsolutePath());
    }
    options.put("isInitiator", "false");
    options.put("useKeyTab", "true");
    options.put("principal", servicePrincipal);
    options.put("storeKey", "true");
    return new AppConfigurationEntry[] {new AppConfigurationEntry(Krb5LoginModule.class.getName(), REQUIRED, options)};
  }
});

代码示例来源:origin: io.airlift/log

@Test
public void testIsDebugEnabled()
{
  inner.setLevel(Level.FINE);
  assertTrue(logger.isDebugEnabled());
  inner.setLevel(Level.INFO);
  assertFalse(logger.isDebugEnabled());
  inner.setLevel(Level.WARNING);
  assertFalse(logger.isDebugEnabled());
  inner.setLevel(Level.SEVERE);
  assertFalse(logger.isDebugEnabled());
}

代码示例来源:origin: com.teradata.airlift/log

@Test
public void testIsDebugEnabled()
{
  inner.setLevel(Level.FINE);
  assertTrue(logger.isDebugEnabled());
  inner.setLevel(Level.INFO);
  assertFalse(logger.isDebugEnabled());
  inner.setLevel(Level.WARNING);
  assertFalse(logger.isDebugEnabled());
  inner.setLevel(Level.SEVERE);
  assertFalse(logger.isDebugEnabled());
}

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

@Test
public void testIsDebugEnabled()
{
  inner.setLevel(Level.FINE);
  assertTrue(logger.isDebugEnabled());
  inner.setLevel(Level.INFO);
  assertFalse(logger.isDebugEnabled());
  inner.setLevel(Level.WARNING);
  assertFalse(logger.isDebugEnabled());
  inner.setLevel(Level.SEVERE);
  assertFalse(logger.isDebugEnabled());
}

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

void logDiagnosticsInfo(HttpClient httpClient)
  {
    if (!log.isDebugEnabled() || !rateLimiter.tryAcquire()) {
      return;
    }

    log.debug(httpClient.dump());
  }
}

代码示例来源:origin: com.teradata.airlift/log-manager

@Test
public void testPropagatesLevels()
    throws Exception
{
  Logging logging = Logging.initialize();
  Logger logger = Logger.get("testPropagatesLevels");
  logging.setLevel("testPropagatesLevels", Level.ERROR);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevels", Level.WARN);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevels", Level.INFO);
  assertFalse(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevels", Level.DEBUG);
  assertTrue(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
}

代码示例来源:origin: io.airlift/log-manager

@Test
public void testPropagatesLevelsHierarchical()
    throws Exception
{
  Logging logging = Logging.initialize();
  Logger logger = Logger.get("testPropagatesLevelsHierarchical.child");
  logging.setLevel("testPropagatesLevelsHierarchical", Level.ERROR);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevelsHierarchical", Level.WARN);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevelsHierarchical", Level.INFO);
  assertFalse(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevelsHierarchical", Level.DEBUG);
  assertTrue(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
}

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

@Test
public void testPropagatesLevelsHierarchical()
    throws Exception
{
  Logging logging = Logging.initialize();
  Logger logger = Logger.get("testPropagatesLevelsHierarchical.child");
  logging.setLevel("testPropagatesLevelsHierarchical", Level.ERROR);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevelsHierarchical", Level.WARN);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevelsHierarchical", Level.INFO);
  assertFalse(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevelsHierarchical", Level.DEBUG);
  assertTrue(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
}

代码示例来源:origin: com.teradata.airlift/log-manager

@Test
public void testPropagatesLevelsHierarchical()
    throws Exception
{
  Logging logging = Logging.initialize();
  Logger logger = Logger.get("testPropagatesLevelsHierarchical.child");
  logging.setLevel("testPropagatesLevelsHierarchical", Level.ERROR);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevelsHierarchical", Level.WARN);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevelsHierarchical", Level.INFO);
  assertFalse(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevelsHierarchical", Level.DEBUG);
  assertTrue(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
}

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

@Test
public void testPropagatesLevels()
    throws Exception
{
  Logging logging = Logging.initialize();
  Logger logger = Logger.get("testPropagatesLevels");
  logging.setLevel("testPropagatesLevels", Level.ERROR);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevels", Level.WARN);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevels", Level.INFO);
  assertFalse(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevels", Level.DEBUG);
  assertTrue(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
}

代码示例来源:origin: com.teradata.airlift/log-manager

@Test
  public void testChildLevelOverridesParent()
      throws Exception
  {
    Logging logging = Logging.initialize();
    Logger logger = Logger.get("testChildLevelOverridesParent.child");

    logging.setLevel("testChildLevelOverridesParent", Level.DEBUG);
    logging.setLevel("testChildLevelOverridesParent.child", Level.ERROR);
    assertFalse(logger.isDebugEnabled());
    assertFalse(logger.isInfoEnabled());
  }
}

代码示例来源:origin: io.airlift/log-manager

@Test
public void testPropagatesLevels()
    throws Exception
{
  Logging logging = Logging.initialize();
  Logger logger = Logger.get("testPropagatesLevels");
  logging.setLevel("testPropagatesLevels", Level.ERROR);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevels", Level.WARN);
  assertFalse(logger.isDebugEnabled());
  assertFalse(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevels", Level.INFO);
  assertFalse(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
  logging.setLevel("testPropagatesLevels", Level.DEBUG);
  assertTrue(logger.isDebugEnabled());
  assertTrue(logger.isInfoEnabled());
}

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

@Test
  public void testChildLevelOverridesParent()
      throws Exception
  {
    Logging logging = Logging.initialize();
    Logger logger = Logger.get("testChildLevelOverridesParent.child");

    logging.setLevel("testChildLevelOverridesParent", Level.DEBUG);
    logging.setLevel("testChildLevelOverridesParent.child", Level.ERROR);
    assertFalse(logger.isDebugEnabled());
    assertFalse(logger.isInfoEnabled());
  }
}

代码示例来源:origin: io.airlift/log-manager

@Test
  public void testChildLevelOverridesParent()
      throws Exception
  {
    Logging logging = Logging.initialize();
    Logger logger = Logger.get("testChildLevelOverridesParent.child");

    logging.setLevel("testChildLevelOverridesParent", Level.DEBUG);
    logging.setLevel("testChildLevelOverridesParent.child", Level.ERROR);
    assertFalse(logger.isDebugEnabled());
    assertFalse(logger.isInfoEnabled());
  }
}

相关文章