我正在使用fixedformat4j依赖性,并且可以关闭调试日志记录...
<dependency>
<groupId>com.ancientprogramming.fixedformat4j</groupId>
<artifactId>fixedformat4j</artifactId>
<version>1.2.2</version>
</dependency>
这是一些示例日志
11:14:21.737 [main] DEBUG com.ancientprogramming.fixedformat4j.format.FixedFormatUtil - fetched '0001' from record
11:14:21.742 [main] DEBUG com.ancientprogramming.fixedformat4j.format.impl.FixedFormatManagerImpl - the loaded data[1]
图书馆正在使用Apache Commons日志记录...我无法将其关闭。我只是从Junit v4打电话
package com.example.demo;
import com.ancientprogramming.fixedformat4j.annotation.Field;
import com.ancientprogramming.fixedformat4j.annotation.Record;
import com.ancientprogramming.fixedformat4j.format.FixedFormatManager;
import com.ancientprogramming.fixedformat4j.format.impl.FixedFormatManagerImpl;
import org.junit.Assert;
public class Test {
@org.junit.Test
public void test () {
FixedFormatManager manager = new FixedFormatManagerImpl();
MyDto dto = manager.load(MyDto.class, "0001");
Assert.assertEquals(Integer.valueOf(1),dto.f1);
}
@Record
public class MyDto {
public Integer f1;
public void setF1(Integer f1) {
this.f1 = f1;
}
@Field(offset = 1, length = 4)
public Integer getF1() {
return f1;
}
}
}