6 #ifndef UTILS_LOG_ENTRY_H 7 #define UTILS_LOG_ENTRY_H 10 #include <Utils/API.h> 11 #include <Utils/Time.h> 32 static std::vector<Type> GetWECTypes();
34 static std::vector<Type> GetIWECTypes();
36 explicit LogEntry(
const std::string &message);
38 LogEntry(
Type type,
const std::string &message,
const std::string &caller_name);
40 [[nodiscard]]
static std::string TypeToString(
Type type);
41 [[nodiscard]]
static std::wstring TypeToWstring(
Type type);
43 [[nodiscard]]
Type GetType()
const;
45 [[nodiscard]]
const std::string &GetMessage()
const;
47 [[nodiscard]]
const std::string &GetCaller()
const;
50 friend std::ostream &operator<< (std::ostream &os,
const LogEntry &entry)
56 friend std::ostream &operator << (std::ostream &os, const std::vector<LogEntry> &v)
58 for (
typename std::vector<LogEntry>::const_iterator ii = v.begin(); ii != v.end(); ++ii)
66 friend std::ostream &operator << (std::ostream &os, const std::vector<std::shared_ptr<LogEntry>> &v)
68 for (
typename std::vector<std::shared_ptr<LogEntry>>::const_iterator ii = v.begin(); ii != v.end(); ++ii)
79 [[nodiscard]]
virtual std::string ToString(
const std::string &time_format =
"%Y-%m-%d %H:%M:%S")
const;
81 [[nodiscard]]
bool IsRead()
const;
89 std::string caller_name_;
90 time_m::DateTime time_;
virtual std::string ToString(const std::string &time_format="%Y-%m-%d %H:%M:%S") const
Print the entry to a string.
A single entry for the logging system.
Definition: LogEntry.h:18
General namespace for utilities.
Definition: BulletConversions.h:9
Type
Defines the character of a LogEntry.
Definition: LogEntry.h:22