36 lines
533 B
C++

//
// Created by Nik on 20/05/2022.
//
#ifndef NALOGA1102_LOG_H
#define NALOGA1102_LOG_H
#include <string>
#include <fstream>
enum LogType{
DEBUG, INFO, ERROR, WARNING
};
class Log {
private:
std::ofstream file;
std::string fileName = "log.txt";
public:
Log(LogType type);
~Log();
std::string GetStringLogType(LogType type);
template<typename T>
Log& operator<<(const T &msg){
file << msg;
return *this;
};
};
#endif //NALOGA1102_LOG_H