no message
parent
6865afce40
commit
4c10d2ed2d
|
@ -25,9 +25,9 @@ int _C_Loger::Debug(string dat,string function,int line){
|
||||||
// 还没有过天
|
// 还没有过天
|
||||||
if(getTimeDate() == this->mCurrentDate){
|
if(getTimeDate() == this->mCurrentDate){
|
||||||
string tmp = getTime();
|
string tmp = getTime();
|
||||||
tmp += ":";
|
tmp += ": ";
|
||||||
tmp += dat;
|
tmp += dat;
|
||||||
tmp += "at [" + function + " line " + std::to_string(line) + "]";
|
tmp += "at [" + function + " line " + std::to_string(line) + "]";
|
||||||
tmp += "\n";
|
tmp += "\n";
|
||||||
int ret =fwrite(tmp.c_str(),tmp.size(),1,this->mFile);
|
int ret =fwrite(tmp.c_str(),tmp.size(),1,this->mFile);
|
||||||
fflush(this->mFile);
|
fflush(this->mFile);
|
||||||
|
@ -40,9 +40,9 @@ int _C_Loger::Debug(string dat,string function,int line){
|
||||||
this->error = true;
|
this->error = true;
|
||||||
}
|
}
|
||||||
string tmp = getTime();
|
string tmp = getTime();
|
||||||
tmp += ":";
|
tmp += ": ";
|
||||||
tmp += dat;
|
tmp += dat;
|
||||||
tmp += "at [" + function + " line " + std::to_string(line) + "]";
|
tmp += "at [" + function + " line " + std::to_string(line) + "]";
|
||||||
tmp += "\n";
|
tmp += "\n";
|
||||||
int ret = fwrite(tmp.c_str(),tmp.size(),1,this->mFile);
|
int ret = fwrite(tmp.c_str(),tmp.size(),1,this->mFile);
|
||||||
fflush(this->mFile);
|
fflush(this->mFile);
|
||||||
|
@ -57,7 +57,7 @@ void _C_Loger::operator<<(const string& wb){
|
||||||
string tmp = getTime();
|
string tmp = getTime();
|
||||||
tmp += ":";
|
tmp += ":";
|
||||||
tmp += wb;
|
tmp += wb;
|
||||||
tmp += "\n";
|
tmp += " \n";
|
||||||
fwrite(tmp.c_str(),tmp.size(),1,this->mFile);
|
fwrite(tmp.c_str(),tmp.size(),1,this->mFile);
|
||||||
fflush(this->mFile);
|
fflush(this->mFile);
|
||||||
}else{ // 已经过天了
|
}else{ // 已经过天了
|
||||||
|
@ -67,8 +67,14 @@ void _C_Loger::operator<<(const string& wb){
|
||||||
if (this->mFile == nullptr){
|
if (this->mFile == nullptr){
|
||||||
this->error = true;
|
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) {
|
bool file_existed(string path) {
|
||||||
|
|
Loading…
Reference in New Issue