7 #include "SessionLog.h"
8 #include "Preference.h"
10 #include "Application.h"
15 SessionLog::SessionLog() {
18 p_termOutput = ((QString)slog[
"TerminalOutput"]).toUpper() ==
"ON";
19 p_fileOutput = ((QString)slog[
"FileOutput"]).toUpper() ==
"ON";
20 p_outputFile = (QString) slog[
"FileName"];
21 p_access = ((QString) slog[
"FileAccess"]).toUpper();
24 this->addObject(Isis::iApp->History());
27 p_root = &this->object(0);
33 SessionLog::~SessionLog() {
37 SessionLog *SessionLog::p_log = NULL;
39 SessionLog &SessionLog::TheLog(
bool restart) {
40 if(restart && (p_log != NULL)) {
47 p_log =
new SessionLog();
53 void SessionLog::Write() {
60 if(p_access ==
"OVERWRITE") {
64 this->append(p_outputFile);
68 std::cerr <<
"**WARNING** Unable to write session log [" <<
69 p_outputFile <<
"] Disk may be full or directory permissions not writeable"
77 void SessionLog::AddAccounting() {
79 if(p_acctAdded)
return;
81 p_root->addGroup(Isis::iApp->Accounting());
88 for(
int i = 0; i < e.
groups(); i++) {
90 p_root->addGroup(e.
group(i));
98 p_root->addGroup(results);
103 return operator<<(os, (
Isis::Pvl &) log);
106 void SessionLog::Shutdown() {