Browse Source

Fix panic when closing Box before Start with file log output

世界 3 weeks ago
parent
commit
bf4a9edc89
1 changed files with 1 additions and 0 deletions
  1. 1 0
      log/log.go

+ 1 - 0
log/log.go

@@ -40,6 +40,7 @@ func New(options Options) (Factory, error) {
 	case "stdout":
 		logWriter = os.Stdout
 	default:
+		logWriter = io.Discard
 		logFilePath = logOptions.Output
 	}
 	logFormatter := Formatter{