org.apache.logging.log4j.core.config.Configuration.getNanoClock()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(127)

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

Configuration.getNanoClock介绍

[英]Returns the NanoClock instance for this configuration.
[中]返回此配置的纳米时钟实例。

代码示例

代码示例来源:origin: org.apache.logging.log4j/log4j-core

@Test
public void testNanoPatternLongChangesNanoClockFactoryMode() {
  final Configuration config = new NullConfiguration();
  assertTrue(config.getNanoClock() instanceof DummyNanoClock);
  final PatternParser pp = new PatternParser(config, KEY, null);
  assertTrue(config.getNanoClock() instanceof DummyNanoClock);
  pp.parse("%m");
  assertTrue(config.getNanoClock() instanceof DummyNanoClock);
  pp.parse("%N");
  assertTrue(config.getNanoClock() instanceof SystemNanoClock);
}

代码示例来源:origin: org.apache.logging.log4j/log4j-core

@Test
public void testNanoPatternShortChangesConfigurationNanoClock() {
  final Configuration config = new NullConfiguration();
  assertTrue(config.getNanoClock() instanceof DummyNanoClock);
  final PatternParser pp = new PatternParser(config, KEY, null);
  assertTrue(config.getNanoClock() instanceof DummyNanoClock);
  pp.parse("%m");
  assertTrue(config.getNanoClock() instanceof DummyNanoClock);
  pp.parse("%nano"); // this changes the config clock
  assertTrue(config.getNanoClock() instanceof SystemNanoClock);
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

/**
 * Constructs an {@code AsyncLogger} with the specified context, name and message factory.
 *
 * @param context context of this logger
 * @param name name of this logger
 * @param messageFactory message factory of this logger
 * @param loggerDisruptor helper class that logging can be delegated to. This object owns the Disruptor.
 */
public AsyncLogger(final LoggerContext context, final String name, final MessageFactory messageFactory,
    final AsyncLoggerDisruptor loggerDisruptor) {
  super(context, name, messageFactory);
  this.loggerDisruptor = loggerDisruptor;
  includeLocation = privateConfig.loggerConfig.isIncludeLocation();
  nanoClock = context.getConfiguration().getNanoClock();
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

@Override
protected void updateConfiguration(final Configuration newConfig) {
  nanoClock = newConfig.getNanoClock();
  includeLocation = newConfig.getLoggerConfig(name).isIncludeLocation();
  super.updateConfiguration(newConfig);
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

Log4jLogEvent.setNanoClock(configuration.getNanoClock());

相关文章