diff --git a/easylogger/src/elog_buf.c b/easylogger/src/elog_buf.c index b4a8f10..933c450 100644 --- a/easylogger/src/elog_buf.c +++ b/easylogger/src/elog_buf.c @@ -82,6 +82,8 @@ void elog_buf_output(const char *log, size_t size) { * flush all buffered logs to output device */ void elog_flush(void) { + if (buf_write_size == 0) + return; /* lock output */ elog_output_lock(); /* output log */