протоколирование Apache Commons - отключить отладку - PullRequest
0 голосов
/ 06 апреля 2019

Я использую зависимость 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;
    }
}
 }
...