Browse Source

err to stderr

apkipa 1 week ago
parent
commit
2d41e3de89
1 changed files with 2 additions and 1 deletions
  1. 2 1
      main.go

+ 2 - 1
main.go

@@ -171,7 +171,8 @@ func initLog() *logrus.Logger {
 
 
 	// 设置错误级别日志输出到额外的文件
 	// 设置错误级别日志输出到额外的文件
 	logger.AddHook(&ErrorHook{
 	logger.AddHook(&ErrorHook{
-		Writer: errorLog,
+		// Writer: errorLog,
+		Writer: io.MultiWriter(os.Stderr, errorLog),
 		LogLevels: []logrus.Level{
 		LogLevels: []logrus.Level{
 			logrus.ErrorLevel,
 			logrus.ErrorLevel,
 			logrus.FatalLevel,
 			logrus.FatalLevel,