Skip to content

Commit

Permalink
Merge pull request markparticle#24 from markparticle/dev_mark
Browse files Browse the repository at this point in the history
🐛 fix bug
  • Loading branch information
markparticle committed Jul 7, 2020
2 parents 152199f + 1debbc0 commit 8f68ff9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 7 additions & 2 deletions code/log/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,13 @@ void Log::AppendLogLevelTitle_(int level) {
}

void Log::flush(void) {
lock_guard<mutex> locker(mtx_);
fflush(fp_);
{
lock_guard<mutex> locker(mtx_);
fflush(fp_);
}
if(isAsync_) {
deque_->flush();
}
}

void Log::AsyncWrite_() {
Expand Down
1 change: 0 additions & 1 deletion code/log/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class Log {
if (log->IsOpen() && log->GetLevel() <= level) {\
log->write(level, format, ##__VA_ARGS__); \
log->flush();\
if(isAsync_) { deque_->flush(); } \
}\
} while(0);

Expand Down

0 comments on commit 8f68ff9

Please sign in to comment.