23 #include <sys/times.h> 47 std::ofstream newFile;
48 newFile.open(this->
filename.c_str(), std::ios::out | append ? std::ios::app : std::ios::trunc);
57 static struct timeval tstart;
58 static struct timezone tz;
61 gettimeofday(&tstart, &tz);
62 ptm = localtime(&tstart.tv_sec);
64 strftime(time,
sizeof (time),
"%Y-%m-%d %H:%M:%S", ptm);
71 sprintf(buffer,
"%s/logs/log_%s", path.c_str(), time.c_str());
static std::string getTimeAsStr()
void setDebugLevel(int debugLevel)
void setInputLevel(int inputLevel)
void setFilename(std::string filename)
void writeLine(std::string line, bool append=true)
static std::string generateLogname(std::string path)