Skip to content

Commit

Permalink
feat: Remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
devanbenz committed Dec 30, 2024
1 parent b9e9eb7 commit a440193
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions query/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,26 +298,7 @@ func initQueryLogWriter(log *zap.Logger, e *Executor, path string) (*os.File, er
return nil, err
}

// If existing logger is a noop then we will just want to log to the provided file
if e.Logger == zap.NewNop() {
existingCore := log.Core()

encoderConfig := zap.NewProductionEncoderConfig()

core := zapcore.NewCore(
zapcore.NewJSONEncoder(encoderConfig),
zapcore.Lock(logFile),
zapcore.InfoLevel,
)
newCore := zapcore.NewTee(existingCore, core)

e.Logger = zap.New(newCore).With(zap.String("service", "query"))
e.TaskManager.Logger = e.Logger
return logFile, nil
}

// If the existing logger exists we just need to register the file to it in order to write to as well
existingCore := e.Logger.Core()
existingCore := log.Core()

encoderConfig := zap.NewProductionEncoderConfig()

Expand Down

0 comments on commit a440193

Please sign in to comment.