You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223
  1. #include "log.h"
  2. #include <iostream>
  3. bool
  4. LogUnit::openLog(const char * filename)
  5. {
  6. if (logFile.is_open()) {
  7. cerr << APPNAME
  8. << ": opening a new Log file, while another is already open"
  9. << endl;
  10. logFile.close();
  11. }
  12. logFile.open(filename, ios_base::app);
  13. return !(logFile.fail());
  14. }
  15. void
  16. LogUnit::closeLog()
  17. {
  18. if (logFile.is_open())
  19. logFile.close();
  20. }