Isis Developer Reference
SessionLog.h
Go to the documentation of this file.
1 #ifndef SessionLog_h
2 #define SessionLog_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include <string>
10 #include "Pvl.h"
11 #include "IException.h"
12 
13 namespace Isis {
24  class SessionLog : private Isis::Pvl {
25  public:
26  static SessionLog &TheLog(bool restart = false);
27  static bool HasLog() {
28  return p_log != NULL;
29  };
30 
31  // Add the Results group
32  void AddResults(Isis::PvlGroup &results);
33 
34  // Write the log to the screen and/or file
35  void Write();
36 
37  // Add an Error to the log
38  void AddError(Isis::Pvl &e);
39 
40  // Will we be logging to the terminal?
41  bool TerminalOutput() {
42  return p_termOutput;
43  };
44 
45  private:
46  SessionLog();
47  ~SessionLog();
48 
49  PvlObject *p_root;
50  bool p_errorAdded;
51 
52  bool p_termOutput;
53  bool p_fileOutput;
54  QString p_outputFile;
55  QString p_access;
56 
57  static SessionLog *p_log;
58 
59  bool p_acctAdded;
60  void AddAccounting();
61  friend std::ostream &operator<<(std::ostream &os, Isis::SessionLog &log);
62  static void Shutdown();
63  };
64 };
65 
66 #endif
Isis::iApp
Application * iApp
Definition: Application.cpp:51
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::PvlObject::group
PvlGroup & group(const int index)
Return the group at the specified index.
Definition: PvlObject.cpp:452
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::SessionLog::operator<<
friend std::ostream & operator<<(std::ostream &os, Isis::SessionLog &log)
Definition: SessionLog.cpp:101
Isis::PvlObject::groups
int groups() const
Returns the number of groups contained.
Definition: PvlObject.h:75
Isis::SessionLog::TerminalOutput
bool TerminalOutput()
Definition: SessionLog.h:41
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::Pvl::write
void write(const QString &file)
Opens and writes PVL information to a file and handles the end of line sequence.
Definition: Pvl.cpp:130
Isis::SessionLog::Write
void Write()
Definition: SessionLog.cpp:53
Isis::SessionLog::AddError
void AddError(Isis::Pvl &e)
Definition: SessionLog.cpp:87
Preference.h
IString.h
Isis::SessionLog
Definition: SessionLog.h:24
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Pvl.h
Isis::operator<<
std::ostream & operator<<(std::ostream &os, Isis::SessionLog &log)
Definition: SessionLog.cpp:101
Isis::PvlContainer::isNamed
bool isNamed(const QString &match) const
Returns whether the given string is equal to the container name or not.
Definition: PvlContainer.h:72
Isis::SessionLog::AddResults
void AddResults(Isis::PvlGroup &results)
Definition: SessionLog.cpp:97
Application.h
IException.h
Isis::SessionLog::TheLog
static SessionLog & TheLog(bool restart=false)
Definition: SessionLog.cpp:39
std
Namespace for the standard library.
Isis::SessionLog::HasLog
static bool HasLog()
Definition: SessionLog.h:27
Isis::Preference::Preferences
static Preference & Preferences(bool unitTest=false)
Definition: Preference.cpp:86
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
SessionLog.h