io.vertx.core.logging.LoggerFactory类的使用及代码示例

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

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

LoggerFactory介绍

暂无

代码示例

代码示例来源:origin: eclipse-vertx/vert.x

/**
 * @deprecated see https://github.com/eclipse-vertx/vert.x/issues/2774
 */
@Deprecated
public static Logger getLogger(final Class<?> clazz) {
 String name = clazz.isAnonymousClass() ?
  clazz.getEnclosingClass().getCanonicalName() :
  clazz.getCanonicalName();
 return getLogger(name);
}

代码示例来源:origin: eclipse-vertx/vert.x

@BeforeClass
public static void initialize() throws IOException {
 System.setProperty("vertx.logger-delegate-factory-class-name", SLF4JLogDelegateFactory.class.getName());
 LoggerFactory.initialise();
}

代码示例来源:origin: eclipse-vertx/vert.x

static ResolverProvider factory(Vertx vertx, AddressResolverOptions options) {
 // For now not really plugable, we just want to not fail when we can't load the async provider
 // that use an unstable API and fallback on the default (blocking) provider
 try {
  if (!Boolean.getBoolean(DISABLE_DNS_RESOLVER_PROP_NAME)) {
   return new DnsResolverProvider((VertxImpl) vertx, options);
  }
 } catch (Throwable e) {
  if (e instanceof VertxException) {
   throw e;
  }
  Logger logger = LoggerFactory.getLogger(ResolverProvider.class);
  logger.info("Using the default address resolver as the dns resolver could not be loaded");
 }
 return new DefaultResolverProvider();
}

代码示例来源:origin: eclipse-vertx/vert.x

@BeforeClass
public static void initialize() throws IOException {
 // Clear value.
 System.setProperty("vertx.logger-delegate-factory-class-name", Log4j2LogDelegateFactory.class.getName());
 LoggerFactory.initialise();
 recording = new StreamRecording();
}

代码示例来源:origin: eclipse-vertx/vert.x

@Override
public void run() {
  LoggerFactory.getLogger(getClass()).info("I'm inside anonymous class");
}

代码示例来源:origin: eclipse-vertx/vert.x

@BeforeClass
public static void initialize() throws IOException {
 // Clear value.
 System.clearProperty("vertx.logger-delegate-factory-class-name");
 LoggerFactory.initialise();
 recording = new Recording();
}

代码示例来源:origin: eclipse-vertx/vert.x

TestLocationAwareLogger(String name) {
 Logger logger = LoggerFactory.getLogger(name);
 SLF4JLogDelegate delegate = (SLF4JLogDelegate) logger.getDelegate();
 this.actual = (org.slf4j.Logger) delegate.unwrap();
}

代码示例来源:origin: io.vertx/vertx-core

@BeforeClass
public static void initialize() throws IOException {
 System.setProperty("vertx.logger-delegate-factory-class-name", SLF4JLogDelegateFactory.class.getName());
 LoggerFactory.initialise();
}

代码示例来源:origin: eclipse-vertx/vert.x

@Test
public void testWarningLocationAware() {
 testWarning(LoggerFactory.getLogger("my-slf4j-logger"));
}

代码示例来源:origin: io.vertx/vertx-core

@BeforeClass
public static void initialize() throws IOException {
 // Clear value.
 System.setProperty("vertx.logger-delegate-factory-class-name", Log4j2LogDelegateFactory.class.getName());
 LoggerFactory.initialise();
 recording = new StreamRecording();
}

代码示例来源:origin: eclipse-vertx/vert.x

@Test
public void testWarning() {
 testWarning(LoggerFactory.getLogger("my-slf4j-logger"));
}

代码示例来源:origin: io.vertx/vertx-core

@BeforeClass
public static void initialize() throws IOException {
 // Clear value.
 System.clearProperty("vertx.logger-delegate-factory-class-name");
 LoggerFactory.initialise();
 recording = new Recording();
}

代码示例来源:origin: eclipse-vertx/vert.x

@Test
public void testInfo() {
 testInfo(LoggerFactory.getLogger("my-slf4j-logger"));
}

代码示例来源:origin: de.braintags/vertx-pojo-mapper-json

@Before
public void setUp() throws Exception {
 LoggerFactory.initialise();
}

代码示例来源:origin: eclipse-vertx/vert.x

@Test
public void testError() {
 testError(LoggerFactory.getLogger("my-slf4j-logger"));
}

代码示例来源:origin: eclipse-vertx/vert.x

@Test
public void testErrorLocationAware() {
 testError(LoggerFactory.getLogger("my-slf4j-logger"));
}

代码示例来源:origin: eclipse-vertx/vert.x

@Test
public void testMethodName() {
 Logger logger = LoggerFactory.getLogger("my-log4j2-logger");
 String result = recording.execute(new Runnable() {
  @Override
  public void run() {
   logger.warn("hello");
  }
 });
 assertTrue(result.contains(".run:"));
}

代码示例来源:origin: eclipse-vertx/vert.x

BareCommand.getTerminationRunnable(vertx, LoggerFactory.getLogger("foo"), () -> asv.set(true)).run();

代码示例来源:origin: eclipse-vertx/vert.x

@Test
public void testDelegateUnwrap() {
 Logger logger = LoggerFactory.getLogger("my-jul-logger");
 LogDelegate delegate = logger.getDelegate();
 assertNotNull("Delegate is null", delegate);
 try {
  java.util.logging.Logger unwrapped = (java.util.logging.Logger) delegate.unwrap();
  assertNotNull("Unwrapped is null", unwrapped);
 } catch (ClassCastException e) {
  fail("Unexpected unwrapped type: " + e.getMessage());
 }
}

代码示例来源:origin: eclipse-vertx/vert.x

@Test
public void testDelegateUnwrap() {
 Logger logger = LoggerFactory.getLogger("my-log4j2-logger");
 LogDelegate delegate = logger.getDelegate();
 assertNotNull("Delegate is null", delegate);
 try {
  org.apache.logging.log4j.Logger unwrapped = (org.apache.logging.log4j.Logger) delegate.unwrap();
  assertNotNull("Unwrapped is null", unwrapped);
 } catch (ClassCastException e) {
  fail("Unexpected unwrapped type: " + e.getMessage());
 }
}

相关文章