Changeset 11942 for trunk/FACT++


Ignore:
Timestamp:
09/02/11 09:36:23 (13 years ago)
Author:
tbretz
Message:
Added append option to OpenLogFile
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r10498 r11942  
    111111//!    Whether the log-file stream is open or not
    112112//
    113 bool WindowLog::OpenLogFile(const string &filename)
     113bool WindowLog::OpenLogFile(const string &filename, bool append)
    114114{
    115115    fMuxFile.lock();
     
    119119        fLogFile.close();
    120120
    121     fLogFile.open(filename);
     121    fLogFile.open(filename, append ? ios::app|ios::in|ios::out : ios::in|ios::out);
     122    if (append)
     123        fLogFile << '\n';
     124
    122125    fMuxFile.unlock();
    123126
  • trunk/FACT++/src/WindowLog.h

    r11529 r11942  
    108108
    109109    /// Open a log-file
    110     bool OpenLogFile(const std::string &filename);
     110    bool OpenLogFile(const std::string &filename, bool append=false);
    111111
    112112    /// Close a log-file
Note: See TracChangeset for help on using the changeset viewer.