added new log prefix, ready for new system

This commit is contained in:
Anonymous275
2020-11-27 19:58:20 +02:00
parent f858c462af
commit fa31090143
5 changed files with 60 additions and 20 deletions
+9
View File
@@ -7,6 +7,8 @@
#include <fstream>
#include <sstream>
#include <chrono>
#include <thread>
std::string getDate() {
typedef std::chrono::duration<int, std::ratio_multiply<std::chrono::hours::period, std::ratio<24>>::type> days;
std::chrono::system_clock::time_point now = std::chrono::system_clock::now();
@@ -70,6 +72,13 @@ void error(const std::string& toPrint) {
std::cout << Print;
addToLog(Print);
}
void fatal(const std::string& toPrint) {
std::string Print = getDate() + Sec("[FATAL] ") + toPrint + "\n";
std::cout << Print;
addToLog(Print);
std::this_thread::sleep_for(std::chrono::seconds(5));
_Exit(-1);
}
void except(const std::string& toPrint) {
std::string Print = getDate() + Sec("[EXCEP] ") + toPrint + "\n";
std::cout << Print;