Avoid opening log output before start &

Replace tracing logs with task monitor
This commit is contained in:
世界
2023-12-04 11:47:25 +08:00
parent 25810b50c1
commit 21283b554a
14 changed files with 231 additions and 266 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"context"
"os"
"time"
@@ -37,7 +38,7 @@ func main() {
func preRun(cmd *cobra.Command, args []string) {
if disableColor {
log.SetStdLogger(log.NewFactory(log.Formatter{BaseTime: time.Now(), DisableColors: true}, os.Stderr, nil).Logger())
log.SetStdLogger(log.NewDefaultFactory(context.Background(), log.Formatter{BaseTime: time.Now(), DisableColors: true}, os.Stderr, "", nil, false).Logger())
}
if workingDir != "" {
_, err := os.Stat(workingDir)