31 SessionLog::SessionLog() {
34 p_termOutput = ((QString)slog[
"TerminalOutput"]).toUpper() ==
"ON";
35 p_fileOutput = ((QString)slog[
"FileOutput"]).toUpper() ==
"ON";
36 p_outputFile = (QString) slog[
"FileName"];
37 p_access = ((QString) slog[
"FileAccess"]).toUpper();
40 this->addObject(Isis::iApp->History());
43 p_root = &this->object(0);
49 SessionLog::~SessionLog() {
53 SessionLog *SessionLog::p_log = NULL;
55 SessionLog &SessionLog::TheLog(
bool restart) {
56 if(restart && (p_log != NULL)) {
63 p_log =
new SessionLog();
69 void SessionLog::Write() {
76 if(p_access ==
"OVERWRITE") {
80 this->append(p_outputFile);
84 std::cerr <<
"**WARNING** Unable to write session log [" <<
85 p_outputFile <<
"] Disk may be full or directory permissions not writeable" 93 void SessionLog::AddAccounting() {
95 if(p_acctAdded)
return;
97 p_root->addGroup(Isis::iApp->Accounting());
103 void SessionLog::AddError(
Isis::Pvl &e) {
104 for(
int i = 0; i < e.
groups(); i++) {
106 p_root->addGroup(e.
group(i));
114 p_root->addGroup(results);
122 void SessionLog::Shutdown() {
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Namespace for the standard library.
QDebug operator<<(QDebug dbg, const Isis::Angle &angleToPrint)
Display an Angle for a debugging statement.
Contains multiple PvlContainers.
Container for cube-like labels.
bool isNamed(const QString &match) const
Returns whether the given string is equal to the container name or not.
PvlGroup & group(const int index)
Return the group at the specified index.
Namespace for ISIS/Bullet specific routines.
int groups() const
Returns the number of groups contained.
void write(const QString &file)
Opens and writes PVL information to a file and handles the end of line sequence.