consolidate all repos to one for archive
This commit is contained in:
35
semester_2/programiranje_2/naloga1102/Log.h
Normal file
35
semester_2/programiranje_2/naloga1102/Log.h
Normal file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// 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
|
||||
Reference in New Issue
Block a user