Write To Only One File For Geth Logs (#10769)

This commit is contained in:
Nishant Das 2022-05-27 21:06:30 +08:00 committed by GitHub
parent 1dec9eb912
commit 9be2111b7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -151,11 +151,10 @@ func (m *Miner) Start(ctx context.Context) error {
}
runCmd := exec.CommandContext(ctx, binaryPath, args...) // #nosec G204 -- Safe
file, err := helpers.DeleteAndCreateFile(e2e.TestParams.LogPath, "eth1_miner.log")
file, err := os.Create(path.Join(e2e.TestParams.LogPath, "eth1_miner.log"))
if err != nil {
return err
}
runCmd.Stdout = file
runCmd.Stderr = file
log.Infof("Starting eth1 miner with flags: %s", strings.Join(args[2:], " "))

View File

@ -98,11 +98,10 @@ func (node *Node) Start(ctx context.Context) error {
args = append(args, []string{"--syncmode=full"}...)
}
runCmd := exec.CommandContext(ctx, binaryPath, args...) // #nosec G204 -- Safe
file, err := helpers.DeleteAndCreateFile(e2e.TestParams.LogPath, "eth1_"+strconv.Itoa(node.index)+".log")
file, err := os.Create(path.Join(e2e.TestParams.LogPath, "eth1_"+strconv.Itoa(node.index)+".log"))
if err != nil {
return err
}
runCmd.Stdout = file
runCmd.Stderr = file
log.Infof("Starting eth1 node %d with flags: %s", node.index, strings.Join(args[2:], " "))