mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add tinylog2 support
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package cn.hutool.log.test;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import cn.hutool.log.LogFactory;
|
||||
import cn.hutool.log.dialect.commons.ApacheCommonsLogFactory;
|
||||
@@ -11,7 +9,9 @@ import cn.hutool.log.dialect.jdk.JdkLogFactory;
|
||||
import cn.hutool.log.dialect.log4j.Log4jLogFactory;
|
||||
import cn.hutool.log.dialect.log4j2.Log4j2LogFactory;
|
||||
import cn.hutool.log.dialect.slf4j.Slf4jLogFactory;
|
||||
import cn.hutool.log.dialect.tinylog.TinyLog2Factory;
|
||||
import cn.hutool.log.dialect.tinylog.TinyLogFactory;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* 日志门面单元测试
|
||||
@@ -62,6 +62,17 @@ public class CustomLogTest {
|
||||
log.info((String)null);
|
||||
log.info("This is custom '{}' log\n{}", factory.getName(), LINE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tinyLog2Test(){
|
||||
LogFactory factory = new TinyLog2Factory();
|
||||
LogFactory.setCurrentLogFactory(factory);
|
||||
Log log = LogFactory.get();
|
||||
|
||||
log.info(null);
|
||||
log.info((String)null);
|
||||
log.info("This is custom '{}' log\n{}", factory.getName(), LINE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void log4j2LogTest(){
|
||||
|
@@ -5,7 +5,9 @@
|
||||
|
||||
# \u65e5\u5fd7\u5199\u51fa\u65b9\u5f0f\uff1a[console] [file] [jdbc] [logcat] [rollingfile] [sharedfile] [null]
|
||||
tinylog.writer = console
|
||||
writer = console
|
||||
# \u65e5\u5fd7\u5199\u51fa\u7ea7\u522b\uff1aTRACE < DEBUG < INFO < WARNING < ERROR < OFF
|
||||
tinylog.level = debug
|
||||
# \u65e5\u5fd7\u6253\u5370\u683c\u5f0f
|
||||
tinylog.format = [{date:HH:mm:ss}][{level}] {class}:{line} - {message}
|
||||
tinylog.format = [{date:HH:mm:ss}][{level}] {class}:{line} - {message}
|
||||
writer.format = [{date:HH:mm:ss}][{level}] {class}:{line} - {message}
|
Reference in New Issue
Block a user