logmeow/log.h

20 lines
413 B
C
Raw Normal View History

2023-01-05 10:27:14 +00:00
#pragma once
2023-03-30 14:24:01 +00:00
#include <ctime>
2023-01-05 10:27:14 +00:00
#include <string>
#include <vector>
2023-01-29 08:21:22 +00:00
struct LogEntry {
2023-03-30 14:24:01 +00:00
struct tm time;
2023-01-29 08:21:22 +00:00
std::string message;
2023-01-05 10:27:14 +00:00
2023-01-29 08:21:22 +00:00
LogEntry() = default;
2023-06-21 11:45:08 +00:00
LogEntry(time_t time_, std::string message_);
2023-01-29 08:21:22 +00:00
};
extern std::vector<LogEntry> log_entries;
2023-02-09 07:44:34 +00:00
std::string to_string(const LogEntry& entry);
2023-01-29 08:21:22 +00:00
void print_log(const LogEntry& entry);
void log(LogEntry entry, bool print = true);
2023-01-07 09:15:21 +00:00
void log(std::string entry);