consolidate all repos to one for archive

This commit is contained in:
2025-01-28 13:46:42 +01:00
commit a6610fbc7a
5350 changed files with 2705721 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
//
// Created by Nik on 20/05/2022.
//
#include "Log.h"
#include <ctime>
Log::Log(LogType type) {
file.open(fileName,std::ios_base::out | std::ios_base::app);
time_t now = time(0);
tm* strucTime = localtime(&now);
std::string time;
time = std::to_string(strucTime->tm_year + 1900) + "-" +
std::to_string(strucTime->tm_mon + 1) + "-" +
std::to_string(strucTime->tm_mday) + " " +
std::to_string(strucTime->tm_hour) + ":" +
std::to_string(strucTime->tm_min) + ":" +
std::to_string(strucTime->tm_sec) + " ";
operator<<(time + GetStringLogType(type));
}
Log::~Log() {
file.close();
}
std::string Log::GetStringLogType(LogType type) {
switch (type) {
case LogType::ERROR:
return "[ERROR] ";
case LogType::INFO:
return "[INFO] ";
case LogType::DEBUG:
return "[DEBUG] ";
}
return "ERROR";
}