Version 0.0.1

This commit is contained in:
unrealdragon 2026-05-14 15:27:08 +05:30
commit 276fa5d738

41
log.h Normal file
View file

@ -0,0 +1,41 @@
#ifndef LOG_H
#define LOG_H
#include <fstream>
#include <iostream>
#include <filesystem>
class Log {
std::ostream log_file;
std::fstream log_file_s;
public:
explicit Log(std::string file_name, int max_size);
explicit Log(int *other);
~Log();
Log(const Log &other);
void copyFromOther(const Log &other);
bool isOpen();
std::ostream& rdbuf();
Log& operator<<(std::filesystem::path p);
Log& operator<<(std::ostream&(*f)(std::ostream&));
template<typename T>
Log &operator<<(T t) {
log_file << t;
std::cout << t;
return *this;
}
template<typename T>
Log &operator<<(const T *t) {
log_file << t;
std::cout << t;
return *this;
}
template<typename T>
Log &operator<<(T *t) {
log_file << t;
std::cout << t;
return *this;
}
};
#endif // LOG_H