From 239d3e684c3573f6512c9518a16ccc67292fcf53 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Sun, 24 Jun 2018 18:40:38 +0800 Subject: [PATCH] =?UTF-8?q?Log=E7=BB=84=E4=BB=B6=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=A4=84=E7=90=86fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xxl/job/core/log/XxlJobLogger.java | 2 +- .../sample/jfinal/jobhandler/ShardingJobHandler.java | 6 +++--- .../executor/sample/nutz/jobhandler/ShardingJobHandler.java | 6 +++--- .../job/executor/service/jobhandler/ShardingJobHandler.java | 6 +++--- .../{Application.java => XxlJobExecutorApplication.java} | 4 ++-- .../job/executor/service/jobhandler/ShardingJobHandler.java | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) rename xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/{Application.java => XxlJobExecutorApplication.java} (66%) diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobLogger.java b/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobLogger.java index dbd394a2..dcfd7bf3 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobLogger.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobLogger.java @@ -55,7 +55,7 @@ public class XxlJobLogger { */ public static void log(String appendLogPattern, Object ... appendLogArguments) { - FormattingTuple ft = MessageFormatter.format(appendLogPattern, appendLogArguments); + FormattingTuple ft = MessageFormatter.arrayFormat(appendLogPattern, appendLogArguments); String appendLog = ft.getMessage(); /*appendLog = appendLogPattern; diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-jfinal/src/main/java/com/xuxueli/executor/sample/jfinal/jobhandler/ShardingJobHandler.java b/xxl-job-executor-samples/xxl-job-executor-sample-jfinal/src/main/java/com/xuxueli/executor/sample/jfinal/jobhandler/ShardingJobHandler.java index 85bd70cd..e881f734 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-jfinal/src/main/java/com/xuxueli/executor/sample/jfinal/jobhandler/ShardingJobHandler.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-jfinal/src/main/java/com/xuxueli/executor/sample/jfinal/jobhandler/ShardingJobHandler.java @@ -18,14 +18,14 @@ public class ShardingJobHandler extends IJobHandler { // 分片参数 ShardingUtil.ShardingVO shardingVO = ShardingUtil.getShardingVo(); - XxlJobLogger.log("分片参数:当前分片序号 = {0}, 总分片数 = {1}", shardingVO.getIndex(), shardingVO.getTotal()); + XxlJobLogger.log("分片参数:当前分片序号 = {}, 总分片数 = {}", shardingVO.getIndex(), shardingVO.getTotal()); // 业务逻辑 for (int i = 0; i < shardingVO.getTotal(); i++) { if (i == shardingVO.getIndex()) { - XxlJobLogger.log("第 {0} 片, 命中分片开始处理", i); + XxlJobLogger.log("第 {} 片, 命中分片开始处理", i); } else { - XxlJobLogger.log("第 {0} 片, 忽略", i); + XxlJobLogger.log("第 {} 片, 忽略", i); } } diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/ShardingJobHandler.java b/xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/ShardingJobHandler.java index f374731d..9681bf1a 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/ShardingJobHandler.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/ShardingJobHandler.java @@ -22,14 +22,14 @@ public class ShardingJobHandler extends IJobHandler { // 分片参数 ShardingUtil.ShardingVO shardingVO = ShardingUtil.getShardingVo(); - XxlJobLogger.log("分片参数:当前分片序号 = {0}, 总分片数 = {1}", shardingVO.getIndex(), shardingVO.getTotal()); + XxlJobLogger.log("分片参数:当前分片序号 = {}, 总分片数 = {}", shardingVO.getIndex(), shardingVO.getTotal()); // 业务逻辑 for (int i = 0; i < shardingVO.getTotal(); i++) { if (i == shardingVO.getIndex()) { - XxlJobLogger.log("第 {0} 片, 命中分片开始处理", i); + XxlJobLogger.log("第 {} 片, 命中分片开始处理", i); } else { - XxlJobLogger.log("第 {0} 片, 忽略", i); + XxlJobLogger.log("第 {} 片, 忽略", i); } } diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/main/java/com/xxl/job/executor/service/jobhandler/ShardingJobHandler.java b/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/main/java/com/xxl/job/executor/service/jobhandler/ShardingJobHandler.java index 70578097..9b7408fe 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/main/java/com/xxl/job/executor/service/jobhandler/ShardingJobHandler.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/main/java/com/xxl/job/executor/service/jobhandler/ShardingJobHandler.java @@ -22,14 +22,14 @@ public class ShardingJobHandler extends IJobHandler { // 分片参数 ShardingUtil.ShardingVO shardingVO = ShardingUtil.getShardingVo(); - XxlJobLogger.log("分片参数:当前分片序号 = {0}, 总分片数 = {1}", shardingVO.getIndex(), shardingVO.getTotal()); + XxlJobLogger.log("分片参数:当前分片序号 = {}, 总分片数 = {}", shardingVO.getIndex(), shardingVO.getTotal()); // 业务逻辑 for (int i = 0; i < shardingVO.getTotal(); i++) { if (i == shardingVO.getIndex()) { - XxlJobLogger.log("第 {0} 片, 命中分片开始处理", i); + XxlJobLogger.log("第 {} 片, 命中分片开始处理", i); } else { - XxlJobLogger.log("第 {0} 片, 忽略", i); + XxlJobLogger.log("第 {} 片, 忽略", i); } } diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/Application.java b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/XxlJobExecutorApplication.java similarity index 66% rename from xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/Application.java rename to xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/XxlJobExecutorApplication.java index 51a0e457..27fd6268 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/Application.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/XxlJobExecutorApplication.java @@ -4,10 +4,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -public class Application { +public class XxlJobExecutorApplication { public static void main(String[] args) { - SpringApplication.run(Application.class, args); + SpringApplication.run(XxlJobExecutorApplication.class, args); } } \ No newline at end of file diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/ShardingJobHandler.java b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/ShardingJobHandler.java index b58871fe..96acab5a 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/ShardingJobHandler.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/ShardingJobHandler.java @@ -22,14 +22,14 @@ public class ShardingJobHandler extends IJobHandler { // 分片参数 ShardingUtil.ShardingVO shardingVO = ShardingUtil.getShardingVo(); - XxlJobLogger.log("分片参数:当前分片序号 = {0}, 总分片数 = {1}", shardingVO.getIndex(), shardingVO.getTotal()); + XxlJobLogger.log("分片参数:当前分片序号 = {}, 总分片数 = {}", shardingVO.getIndex(), shardingVO.getTotal()); // 业务逻辑 for (int i = 0; i < shardingVO.getTotal(); i++) { if (i == shardingVO.getIndex()) { - XxlJobLogger.log("第 {0} 片, 命中分片开始处理", i); + XxlJobLogger.log("第 {} 片, 命中分片开始处理", i); } else { - XxlJobLogger.log("第 {0} 片, 忽略", i); + XxlJobLogger.log("第 {} 片, 忽略", i); } }