提交 68df81e0 编写于 作者: 如梦技术's avatar 如梦技术 🐛

新增一个 mica-tinylog 组件。

上级 4498072d
dependencies {
implementation "org.tinylog:slf4j-tinylog:${tinylogVersion}"
implementation "org.tinylog:tinylog-impl:${tinylogVersion}"
api "org.tinylog:slf4j-tinylog:${tinylogVersion}"
api "org.tinylog:tinylog-impl:${tinylogVersion}"
implementation "org.springframework.boot:spring-boot"
compileOnly "org.springframework.cloud:spring-cloud-context"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:$springBootVersion"
......
......@@ -19,7 +19,6 @@ package net.dreamlu.mica.tinylog.core;
import org.springframework.boot.context.properties.bind.Bindable;
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.boot.logging.*;
import org.springframework.boot.logging.logback.LogbackLoggingSystem;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment;
import org.springframework.util.ClassUtils;
......@@ -62,18 +61,18 @@ public class TinyLogLoggingSystem extends Slf4JLoggingSystem {
}
/**
* {@link LoggingSystemFactory} that returns {@link LogbackLoggingSystem} if possible.
* {@link LoggingSystemFactory} that returns {@link TinyLogLoggingSystem} if possible.
*/
@Order
public static class Factory implements LoggingSystemFactory {
private static final boolean PRESENT = ClassUtils.isPresent("org.tinylog.Logger",
LogbackLoggingSystem.Factory.class.getClassLoader());
TinyLogLoggingSystem.Factory.class.getClassLoader());
@Override
public LoggingSystem getLoggingSystem(ClassLoader classLoader) {
if (PRESENT) {
return new LogbackLoggingSystem(classLoader);
return new TinyLogLoggingSystem(classLoader);
}
return null;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册