12enum class ePrettyPrintType { Action = 0, Condition };
19 CDM_DECL std::string
PrettyPrint(
const std::string& str, ePrettyPrintType ppt);
27 Loggable(std::string
const& logfile);
30 virtual Logger* GetLogger()
const;
31 virtual void SetLogger(
Logger& logger);
33 virtual void Debug(std::string
const& msg)
const;
34 virtual void Debug(std::stringstream &msg)
const;
35 virtual void Debug(std::ostream &msg)
const;
37 virtual void Info(std::string
const& msg)
const;
38 virtual void Info(std::stringstream &msg)
const;
39 virtual void Info(
const std::stringstream &msg)
const;
40 virtual void Info(std::ostream &msg)
const;
42 virtual void Warning(std::string
const& msg)
const;
43 virtual void Warning(std::stringstream &msg)
const;
44 virtual void Warning(std::ostream &msg)
const;
46 virtual void Error(std::string
const& msg)
const;
47 virtual void Error(std::stringstream &msg)
const;
48 virtual void Error(std::ostream &msg)
const;
50 virtual void Fatal(std::string
const& msg)
const;
51 virtual void Fatal(std::stringstream &msg)
const;
52 virtual void Fatal(std::ostream &msg)
const;
74 Logger(std::string
const& logFilename =
"");
77 void LogToConsole(
bool b);
78 bool IsLoggingToConsole();
80 void AddConsolePrefix(
const std::string& p);
82 void SetLogFile(std::string
const& logFilename =
"");
92 void SetLogLevel(Level level);
93 Level GetLogLevel()
const;
98 virtual bool HasForward()
const;
101 virtual void RemoveForwards();
103 virtual void Debug(std::string
const& msg);
104 virtual void Debug(std::stringstream &msg);
105 virtual void Debug(std::ostream &msg);
107 virtual void Info(std::string
const& msg);
108 virtual void Info(std::stringstream &msg);
109 virtual void Info(
const std::stringstream &msg);
110 virtual void Info(std::ostream &msg);
112 virtual void Warning(std::string
const& msg);
113 virtual void Warning(std::stringstream &msg);
114 virtual void Warning(std::ostream &msg);
116 virtual void Error(std::string
const& msg);
117 virtual void Error(std::stringstream &msg);
118 virtual void Error(std::ostream &msg);
120 virtual void Fatal(std::string
const& msg);
121 virtual void Fatal(std::stringstream &msg);
122 virtual void Fatal(std::ostream &msg);
126 virtual std::string FormatLogMessage(std::string
const& msg);
141 bool static SerializeToString(
const LogMessages& msgs, std::string& output, eSerializationFormat m,
Logger* logger);
142 bool static SerializeFromString(
const std::string& src,
LogMessages& msgs, eSerializationFormat m,
Logger* logger);
148 warning_msgs.clear();
155 if (!debug_msgs.empty())
157 if (!info_msgs.empty())
159 if (!warning_msgs.empty())
161 if (!error_msgs.empty())
163 if (!fatal_msgs.empty())
175inline std::ostream& operator<< (std::ostream& out,
const LogMessages& a)
179 out <<
"Debug Messages: \n";
185 out <<
"Info Messages: \n";
191 out <<
"Warning Messages: \n";
197 out <<
"Error Messages: \n";
203 out <<
"Fatal Messages: \n";
std::vector< std::string > fatal_msgs
Definition: Logger.h:172
std::vector< std::string > error_msgs
Definition: Logger.h:171
virtual ~LogMessages()
Definition: Logger.h:139
void Clear()
Definition: Logger.h:144
std::vector< std::string > info_msgs
Definition: Logger.h:169
std::vector< std::string > debug_msgs
Definition: Logger.h:168
LogMessages()
Definition: Logger.h:138
bool IsEmpty()
Definition: Logger.h:153
std::vector< std::string > warning_msgs
Definition: Logger.h:170
bool myLogger
Definition: Logger.h:55
Logger * m_Logger
Definition: Logger.h:56
virtual ~LoggerForward()=default
virtual void ForwardFatal(std::string const &)
Definition: Logger.h:67
virtual void ForwardDebug(std::string const &)
Definition: Logger.h:63
virtual void ForwardWarning(std::string const &)
Definition: Logger.h:65
virtual void ForwardError(std::string const &)
Definition: Logger.h:66
virtual void ForwardInfo(std::string const &)
Definition: Logger.h:64
std::vector< LoggerForward * > m_Forwards
Definition: Logger.h:128
const SEScalarTime * m_time
Definition: Logger.h:129
friend Loggable
Definition: Logger.h:72
log_lib * _log_lib
Definition: Logger.h:132
Level
Definition: Logger.h:85
Definition: SEScalarTime.h:28
Definition: SimpleLogger.cpp:10
CDM_DECL std::string PrettyPrint(const std::string &str, ePrettyPrintType ppt)
Definition: Logger.cpp:30
CDM_DECL std::string to_string(float f)
Definition: Logger.cpp:22