perf(logging): optimize multi-line message formatting

- Refactors the fmtMessage function to use strings.Builder
  - Simplifies multi-writer creation with a helper function
  - Updates the new console writer initialization pattern
  - Moves InitLogger function to the top
  - Fixed NewLoggerWithFixedLevel
This commit is contained in:
yusing
2025-10-15 21:18:25 +08:00
parent f5a006ce81
commit ddf78aacba
3 changed files with 59 additions and 42 deletions

View File

@@ -55,7 +55,7 @@ func NewState() config.State {
entrypoint: entrypoint.NewEntrypoint(),
task: task.RootTask("config", false),
tmpLogBuf: tmpLogBuf,
tmpLog: logging.NewLogger(tmpLogBuf),
tmpLog: logging.NewLoggerWithFixedLevel(zerolog.InfoLevel, tmpLogBuf),
}
}