1 #ifndef NTA_LOGGER_H_INCLUDED
2 #define NTA_LOGGER_H_INCLUDED
6 #include "nta/Errors.h"
7 #include "nta/format.h"
18 static const size_t TAB_SIZE;
28 template<
typename... Args>
29 static void writeToLog(crstring entry, Args&&... args) {
34 template<
typename... Args>
39 static void indent(
size_t tab_size = TAB_SIZE);
41 static void unindent(
size_t tab_size = TAB_SIZE);
46 const std::string on_exit;
48 ScopeLog(crstring entry, crstring exit);
53 #endif // NTA_LOGGER_H_INCLUDED
stores program information in internal and external logs
Simple RAII type for logging entry/exit of scope.
static void writeToLog(crstring entry)
writes an entry in the log
static void unindent(size_t tab_size=TAB_SIZE)
unindents entries
std::string format(const std::string &fmt, Args &&... args)
static void useSecondLog(std::ostream &stream)
Sets a secondary stream for logging.
static std::ofstream m_logFile
the file that keeps the external log
static Error writeErrorToLog(crstring error, ErrorType type=OTHER)
writes entry in log and then notifies ErrorManager
static void createLog()
creates the log
static void unuseSecondLog()
Stop using a secondary stream.
static std::ostream * m_secondLog
Optional secondary stream to log data to as well.
static void indent(size_t tab_size=TAB_SIZE)
indents entries