瀏覽代碼

解决批量打印 sql 输出 null

hubin 5 年之前
父節點
當前提交
92ed94efe2

+ 1 - 1
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/p6spy/P6SpyLogger.java

@@ -32,6 +32,6 @@ public class P6SpyLogger implements MessageFormattingStrategy {
     public String formatMessage(int connectionId, String now, long elapsed, String category,
                                 String prepared, String sql, String url) {
         return StringUtils.isNotBlank(sql) ? " Consume Time:" + elapsed + " ms " + now +
-            "\n Execute SQL:" + sql.replaceAll("[\\s]+", " ") + "\n" : null;
+            "\n Execute SQL:" + sql.replaceAll("[\\s]+", " ") + "\n" : "";
     }
 }