Skip to content

Commit

Permalink
Revert "Add Translator Logs To Log Writer And Stdout/Stderr (aws#342)" (
Browse files Browse the repository at this point in the history
  • Loading branch information
SaxyPandaBear authored Jul 27, 2023
1 parent 09bac85 commit 7668364
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,14 @@ var runInContainer = os.Getenv(config.RUN_IN_CONTAINER)

func translateConfig() error {
args := []string{"--output", tomlConfigPath, "--mode", "auto"}
var stdoutIOWriter io.Writer
var stderrIOWriter io.Writer
if runInContainer == config.RUN_IN_CONTAINER_TRUE {
args = append(args, "--input-dir", CONFIG_DIR_IN_CONTAINER)
stdoutIOWriter = os.Stdout
stderrIOWriter = os.Stderr
} else {
args = append(args, "--input", jsonConfigPath, "--input-dir", jsonDirPath, "--config", commonConfigPath)
stdoutIOWriter = io.MultiWriter(log.Writer(), os.Stdout)
stderrIOWriter = io.MultiWriter(log.Writer(), os.Stderr)
}
cmd := exec.Command(translatorBinaryPath, args...)
cmd.Stdout = stdoutIOWriter
cmd.Stderr = stderrIOWriter
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stdout
err := cmd.Run()
if err != nil {
if exitErr, ok := err.(*exec.ExitError); ok {
Expand Down

0 comments on commit 7668364

Please sign in to comment.