Changeset 11406


Ignore:
Timestamp:
07/14/11 12:15:03 (13 years ago)
Author:
lyard
Message:
Open the log file right away if path given in configuration
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/datalogger.cc

    r11405 r11406  
    15551555        sub.lastReceivedEvent = cTime;
    15561556        if (!sub.nightlyFile.IsOpen() || !sub.runFile.IsOpen() || sub.runNumber != sub.runFile.fRunNumber)
    1557             OpenFITSFilesPlease(sub, cRunNumber);
     1557            if (GetCurrentState() != kSM_Ready)
     1558                OpenFITSFilesPlease(sub, cRunNumber);
    15581559        WriteToFITS(sub);
    15591560#endif
     
    24882489//   dim_lock();
    24892490   const string baseFileName = CompileFileNameWithPath(fNightlyFilePath, "", "");
    2490     if (fNightlyLogFile.is_open() && !fDestructing)//in case we're destructing the datalogger, wait before closing the log file.
    2491     {
    2492         fNightlyLogFile.close();
    2493         Info("Closed: "+baseFileName+".log");
    2494     }
     2491//we should log everything that we can, even if in Ready state. thus removing this closing (done only in the destructor or at day-change)
     2492//   if (fNightlyLogFile.is_open() && !fDestructing)//in case we're destructing the datalogger, wait before closing the log file.
     2493//    {
     2494//        fNightlyLogFile.close();
     2495//        Info("Closed: "+baseFileName+".log");
     2496//    }
    24952497    if (fNightlyReportFile.is_open())
    24962498    {
     
    26052607         fRunFilePath     = folder;
    26062608         fNightlyFilePath = folder;
     2609         fFullNightlyLogFileName = CompileFileNameWithPath(fNightlyFilePath, "", "log");
     2610         if (!OpenTextFilePlease(fNightlyLogFile, fFullNightlyLogFileName))
     2611             SetCurrentState(kSM_BadNightlyConfig);
    26072612    }
    26082613
Note: See TracChangeset for help on using the changeset viewer.