no message
This commit is contained in:
@@ -2219,15 +2219,15 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
|
||||
}
|
||||
|
||||
public static void appendToFile(String filePath, String format, Object... args) {
|
||||
try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath, true))) {
|
||||
String timestamp = LocalDateTime.now().format(formatter);
|
||||
String content = String.format(format, args);
|
||||
String logLine = String.format("[%s] %s", timestamp, content);
|
||||
writer.write(logLine);
|
||||
writer.newLine(); // 可选:添加换行符
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath, true))) {
|
||||
// String timestamp = LocalDateTime.now().format(formatter);
|
||||
// String content = String.format(format, args);
|
||||
// String logLine = String.format("[%s] %s", timestamp, content);
|
||||
// writer.write(logLine);
|
||||
// writer.newLine(); // 可选:添加换行符
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user