From 386c18684a05d0d8562075ccd574308b6a24069b Mon Sep 17 00:00:00 2001 From: Bharath Vedartham Date: Sat, 5 Aug 2023 13:18:27 +0530 Subject: [PATCH] use io/file package to create the parent directories --- io/logs/logutil.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/io/logs/logutil.go b/io/logs/logutil.go index 381ce55834cf..9ff8889643ec 100644 --- a/io/logs/logutil.go +++ b/io/logs/logutil.go @@ -3,6 +3,7 @@ package logs import ( + "github.com/prysmaticlabs/prysm/v4/io/file" "io" "net/url" "os" @@ -21,7 +22,7 @@ func addLogWriter(w io.Writer) { // ConfigurePersistentLogging adds a log-to-file writer. File content is identical to stdout. func ConfigurePersistentLogging(logFileName string) error { logrus.WithField("logFileName", logFileName).Info("Logs will be made persistent") - if err := os.MkdirAll(filepath.Dir(logFileName), params.BeaconIoConfig().ReadWriteExecutePermissions); err != nil { + if err := file.MkdirAll(filepath.Dir(logFileName)); err != nil { return err } f, err := os.OpenFile(logFileName, os.O_CREATE|os.O_WRONLY|os.O_APPEND, params.BeaconIoConfig().ReadWritePermissions) // #nosec G304