修改:日志输出级别

This commit is contained in:
lxy 2020-08-17 09:41:55 +08:00
parent a5fcc3a26d
commit 2a085daa2a
3 changed files with 4 additions and 6 deletions

View File

@ -5,7 +5,6 @@ import net.tccn.timer.task.Task;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
@ -25,7 +24,7 @@ public class TimerExecutor {
for (Task t : task) {
t.setTimerExecutor(this);
queue.push(t);
logger.log(Level.INFO, "add new task : " + t.getName());
logger.finest("add new task : " + t.getName());
}
}

View File

@ -88,7 +88,7 @@ public class TimerTask implements Task {
long start = System.currentTimeMillis();
job.execute(this);
long end = System.currentTimeMillis();
logger.log(Level.INFO, String.format("task [%s] : not complete -> %s, time: %s ms", getName(), isComplete ? "had complete" : "not complete;", end - start));
logger.finest(String.format("task [%s] : not complete -> %s, time: %s ms", getName(), isComplete ? "had complete" : "not complete;", end - start));
if (!isComplete) {
timerExecutor.add(this, true);

View File

@ -4,7 +4,6 @@ import net.tccn.timer.scheduled.Scheduled;
import net.tccn.timer.scheduled.ScheduledCycle;
import net.tccn.timer.scheduled.ScheduledExpres;
import net.tccn.timer.task.Task;
import org.junit.Test;
import java.time.LocalDateTime;
@ -107,7 +106,7 @@ public class TimerTest {
/**
* 测试各种正则表达式的合法性
*/
@Test
//@Test
public void t4() {
//Pattern pattern = Pattern.compile();
//Minute * 1,3 1-3 */5 3-15/5
@ -131,7 +130,7 @@ public class TimerTest {
/**
* 测试配置的表达式
*/
@Test
//@Test
public void t6() {
//
TimerExecutor timer = new TimerExecutor(3);