update 优化 sql输出性能 去掉锁

This commit is contained in:
疯狂的狮子Li
2026-08-21 12:58:36 +08:00
parent a39cd4d437
commit 5e98cef448
@@ -71,11 +71,6 @@ public class SqlLogInterceptor implements Interceptor {
*/
private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss");
/**
* 控制台输出锁,避免多线程 SQL 日志互相穿插。
*/
private static final ReentrantLock CONSOLE_LOCK = new ReentrantLock();
/**
* SQL 日志配置。
*/
@@ -340,13 +335,7 @@ public class SqlLogInterceptor implements Interceptor {
* @param message 日志内容
*/
private void printConsole(String message) {
CONSOLE_LOCK.lock();
try {
System.err.println(message);
System.err.println();
} finally {
CONSOLE_LOCK.unlock();
}
System.err.print(message + System.lineSeparator() + System.lineSeparator());
}
/**