A library for logging options
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
log/lib/log.hpp

42 lines
651 B

1 year ago
#ifndef _LOG_
#define _LOG_
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <time.h>
#include <sys/stat.h>
#include <mutex>
1 year ago
namespace marcelb {
1 year ago
using namespace std;
class log {
public:
string dir;
bool isKeepOpen;
bool printInConsole;
1 year ago
ofstream logfile;
struct tm * moment;
uint day;
string path;
mutex io;
1 year ago
log (string _dir, bool _isKeepOpen = true, bool _printInConsole = false);
1 year ago
bool isdir();
bool open();
void loose();
void setMoment();
void setPath();
void put(string logline);
void setPrefix(string &logline);
~log();
};
}
1 year ago
#endif