mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
feat: show "WARN" and "ERRO" log level
Signed-off-by: 24sama <jacksama@foxmail.com>
This commit is contained in:
parent
d49557706c
commit
0684d2c392
|
|
@ -18,12 +18,14 @@ package logger
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/kubesphere/kubekey/pkg/core/common"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
|
||||
"github.com/rifflock/lfshook"
|
||||
"github.com/sirupsen/logrus"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/kubesphere/kubekey/pkg/core/common"
|
||||
)
|
||||
|
||||
var Log *KubeKeyLog
|
||||
|
|
@ -41,7 +43,7 @@ func NewLogger(outputPath string, verbose bool) *KubeKeyLog {
|
|||
HideKeys: true,
|
||||
TimestampFormat: "15:04:05 MST",
|
||||
NoColors: true,
|
||||
ShowLevel: logrus.FatalLevel,
|
||||
ShowLevel: logrus.WarnLevel,
|
||||
FieldsDisplayWithOrder: []string{common.Pipeline, common.Module, common.Task, common.Node},
|
||||
}
|
||||
logger.SetFormatter(formatter)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ var log = NewLogger("", true)
|
|||
func TestKubeKey_Print(t *testing.T) {
|
||||
wg := &sync.WaitGroup{}
|
||||
for i := 0; i < 5; i++ {
|
||||
Log.Info("begin")
|
||||
|
||||
log.Info("empty fields")
|
||||
l1 := *log
|
||||
|
|
|
|||
Loading…
Reference in New Issue