Version 0.0.1
This commit is contained in:
parent
9f880ebea5
commit
276fa5d738
1 changed files with 1293 additions and 144 deletions
41
log.h
Normal file
41
log.h
Normal 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
|
||||
Loading…
Reference in a new issue