how to make data writable

So I have a temperature/humidity sensor SHT11 and am datalogging to the sparkfun breakout board for SD/MMC cards. I am having trouble figuring out how to package the sensor readings to be written to the SD card. As the code stands now, I don’t know how to stretch it into a data string, and I’m not sure what the better option would be.

As it stands I have no error codes and the sensor reads properly to the serial port on my mac, but no data is recorded in the csv file except for the headers.

I am working from the Simple Sensirion code sourced from:http://playground.arduino.cc//Code/Sensirion
and the datalogging tutorial by Jeremy Blum, http://www.jeremyblum.com/2011/04/05/tutorial-11-for-arduino-sd-cards-and-datalogging/

Here is the code that believe is most important:

void loop()
{
  tempSensor.measure(&temperature, &humidity, &dewpoint);
  
  
  //Open a file to write to
  //Only one file can be open at a time
  File logFile = SD.open("LOG.csv", FILE_WRITE);
  if (logFile)
  {
    logFile.close();
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.print(" C, Humidity: ");
  Serial.print(humidity);
  Serial.print(" %, Dewpoint: ");
  Serial.print(dewpoint);
  Serial.println(" C");
  
  }
  else
  {
    Serial.println("Couldn't open log file"); 
  }

And here is the whole code:

//My datalogging with SHT11 sensor
//Some code from public domain work by Tom Igoe
//Code adoption from Jeremy Blum
//sensirion code from___

#include <SD.h>         //SD Card Library
#include <Sensirion.h> // Sensirion Library


//SPI SD Card Pins
  //MOSI = Pin 11
  //MISO = Pin 12
  //SCLK = PIN 13
  int CS_pin = 10;

//SHT11 Pins 
const uint8_t dataPin  =  2;
const uint8_t clockPin =  3;


float temperature;
float humidity;
float dewpoint;

Sensirion tempSensor = Sensirion(dataPin, clockPin);

long id = 1;                //Use this to store the id # of our reading.


void setup()
{
  Serial.begin(9600);
  Serial.println("Initializing Card");
  //CS Pin is an output
  pinMode(CS_pin, OUTPUT);
 
  
  //Initialize Card
  if (!SD.begin(CS_pin))
  {
      Serial.println("Card Failure");
      return;
  }
  Serial.println("Card Ready");

 //Write Log File Header
  File logFile = SD.open("LOG.csv", FILE_WRITE);
  if (logFile)
  {
    logFile.println(", , , ,"); //Just a leading blank line, incase there was previous data
    String header = "ID, Temp, Humid, Dew Point";
    logFile.println(header);
    logFile.close();
    Serial.println(header);
  }
  else
  {
    Serial.println("Couldn't open log file");
  }
  
}

void loop()
{
  tempSensor.measure(&temperature, &humidity, &dewpoint);
  
  
  //Open a file to write to
  //Only one file can be open at a time
  File logFile = SD.open("LOG.csv", FILE_WRITE);
  if (logFile)
  {
    logFile.close();
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.print(" C, Humidity: ");
  Serial.print(humidity);
  Serial.print(" %, Dewpoint: ");
  Serial.print(dewpoint);
  Serial.println(" C");
  
  }
  else
  {
    Serial.println("Couldn't open log file"); 
  }
  
  //Increment ID number
  id++;
  
  delay(5000);
}

Thank you for any guidance and advice, it is much appreciated!

first thing you do is close the file and print your output to the serial port, that might be your issue

You are not writing anything to the SD card in the loop() function.

You need to construct the string you want to write to the SD card and then do a:
logFile.println(dataString);

NOTE:
You did things correctly in the setup() function.

You need to construct the string you want to write to the SD card and then do a:
logFile.println(dataString);

No, you don't. There is no reason to package the data in a char array to pass it to the SD function that is going to copy the data to another array. Let that function do the conversion to a string to be copied.

  if (logFile)
  {
    logFile.print("Temperature: ");
    logFile.print(temperature);
    logFile.print(" C, Humidity: ");
    logFile.print(humidity);
    logFile.print(" %, Dewpoint: ");
    logFile.print(dewpoint);
    logFile.println(" C");
    logFile.close();

Thank you so much for the advice! The "logFile" was the key to mirroring the serial port display to the .csv SD file.