no message

master
zcy 2021-05-25 23:19:54 +08:00
parent 6865afce40
commit 4c10d2ed2d
1 changed files with 12 additions and 6 deletions

View File

@ -25,9 +25,9 @@ int _C_Loger::Debug(string dat,string function,int line){
// 还没有过天
if(getTimeDate() == this->mCurrentDate){
string tmp = getTime();
tmp += ":";
tmp += ": ";
tmp += dat;
tmp += "at [" + function + " line " + std::to_string(line) + "]";
tmp += "at [" + function + " line " + std::to_string(line) + "]";
tmp += "\n";
int ret =fwrite(tmp.c_str(),tmp.size(),1,this->mFile);
fflush(this->mFile);
@ -40,9 +40,9 @@ int _C_Loger::Debug(string dat,string function,int line){
this->error = true;
}
string tmp = getTime();
tmp += ":";
tmp += ": ";
tmp += dat;
tmp += "at [" + function + " line " + std::to_string(line) + "]";
tmp += "at [" + function + " line " + std::to_string(line) + "]";
tmp += "\n";
int ret = fwrite(tmp.c_str(),tmp.size(),1,this->mFile);
fflush(this->mFile);
@ -57,7 +57,7 @@ void _C_Loger::operator<<(const string& wb){
string tmp = getTime();
tmp += ":";
tmp += wb;
tmp += "\n";
tmp += " \n";
fwrite(tmp.c_str(),tmp.size(),1,this->mFile);
fflush(this->mFile);
}else{ // 已经过天了
@ -67,8 +67,14 @@ void _C_Loger::operator<<(const string& wb){
if (this->mFile == nullptr){
this->error = true;
}
string tmp = getTime();
tmp += ":";
tmp += wb;
tmp += " \n";
fwrite(tmp.c_str(),tmp.size(),1,this->mFile);
fflush(this->mFile);
}
fprintf(this->mFile,wb.c_str(),wb.size());
}
bool file_existed(string path) {