func logWriterScanner(logger *logrus.Entry, reader *io.PipeReader) { defer reader.Close() scanner := bufio.NewScanner(reader) for scanner.Scan() { logger.Print(scanner.Text()) } if err := scanner.Err(); err != nil { if err == io.EOF { return } logger.Errorf("Error while reading from Writer: %s", err) } }