Merge branch 'dev_arch_opt_3.0' into dev_opt_2.15.0

This commit is contained in:
zhongchao
2023-03-14 10:56:58 +08:00
24 changed files with 518 additions and 97 deletions

View File

@@ -132,32 +132,9 @@ final class LoggerPrinter implements Printer {
}
}
private synchronized void log( String tag, LogLevel logLevel, String msg, Object... args) {
private void log( String tag, LogLevel logLevel, String msg, Object... args) {
String message = this.createMessage(msg, args);
int methodCount = this.getMethodCount();
this.logTopBorder(logLevel, tag);
this.logHeaderContent(logLevel, tag, methodCount);
byte[] bytes = message.getBytes();
int length = bytes.length;
if (length <= 4000) {
if (methodCount > 0) {
this.logDivider(logLevel, tag);
}
this.logContent(logLevel, tag, message);
this.logBottomBorder(logLevel, tag);
} else {
if (methodCount > 0) {
this.logDivider(logLevel, tag);
}
for (int i = 0; i < length; i += 4000) {
int count = Math.min(length - i, 4000);
this.logContent(logLevel, tag, new String(bytes, i, count));
}
this.logBottomBorder(logLevel, tag);
}
logContent(logLevel, tag, message);
}
private void logTopBorder(LogLevel logLevel, String tag) {
@@ -198,11 +175,13 @@ final class LoggerPrinter implements Printer {
}
private void logContent( LogLevel logLevel, String tag, String chunk) {
String[] lines = chunk.split( System.getProperty("line.separator"));
for ( String line : lines) {
this.logChunk(logLevel, tag, "" + line);
}
// String[] lines = chunk.split( System.getProperty("line.separator"));
//
// for ( String line : lines) {
// this.logChunk(logLevel, tag, "║ " + line);
// }
//
logChunk(logLevel, tag, chunk);
}
private void logChunk( LogLevel logLevel, String tag, String chunk) {