From c69740a501f3b826b6b923bb865de79705348114 Mon Sep 17 00:00:00 2001 From: Tudor Malene Date: Fri, 26 Apr 2024 15:56:36 +0100 Subject: [PATCH] fix logging - remove the terminal when a file is specified (#1886) --- go/enclave/enclave.go | 1 - lib/gethfork/debug/flags.go | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go/enclave/enclave.go b/go/enclave/enclave.go index 2b571cca4b..743c1a86ac 100644 --- a/go/enclave/enclave.go +++ b/go/enclave/enclave.go @@ -666,7 +666,6 @@ func (e *enclaveImpl) GetBalance(ctx context.Context, encryptedParams common.Enc return rpc.WithVKEncryption(ctx, e.rpcEncryptionManager, encryptedParams, rpc.GetBalanceValidate, rpc.GetBalanceExecute) } -// todo - needs to be encrypted func (e *enclaveImpl) GetCode(ctx context.Context, address gethcommon.Address, batchHash *gethcommon.Hash) ([]byte, common.SystemError) { if e.stopControl.IsStopping() { return nil, responses.ToInternalError(fmt.Errorf("requested GetCode with the enclave stopping")) diff --git a/lib/gethfork/debug/flags.go b/lib/gethfork/debug/flags.go index a460006e74..e09c667e9c 100644 --- a/lib/gethfork/debug/flags.go +++ b/lib/gethfork/debug/flags.go @@ -218,7 +218,9 @@ func Setup(logFmtFlag string, logFile string, rotation bool, maxSize int, maxBac if logOutputFile, err = os.OpenFile(logFile, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0o644); err != nil { return err } - output = io.MultiWriter(logOutputFile, terminalOutput) + // output = io.MultiWriter(logOutputFile, terminalOutput) + // we only want to print to the file + output = logOutputFile context = append(context, "location", logFile) } else { output = terminalOutput