Skip to content

Commit

Permalink
Merge branch 'master' into logger
Browse files Browse the repository at this point in the history
  • Loading branch information
hyj1991 authored Jan 29, 2022
2 parents 70a3e3d + 5278a3a commit c468f62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void WriteToFile(const LOG_LEVEL output_level, char *log) {
}

static void Log(const LOG_LEVEL output_level, const char *type,
const char *format, va_list arglist = nullptr) {
const char *format, va_list *arglist = nullptr) {
LOG_LEVEL level = GetLogLevel();
if (level < output_level) {
return;
Expand Down Expand Up @@ -142,7 +142,7 @@ static void Log(const LOG_LEVEL output_level, const char *type,
// compose log
char tmp_log[kMaxMessageLength];
if (arglist != nullptr)
vsnprintf(tmp_log, sizeof(tmp_log), tmp_format, arglist);
vsnprintf(tmp_log, sizeof(tmp_log), tmp_format, *arglist);
else
snprintf(tmp_log, sizeof(tmp_log), "%s", tmp_format);

Expand Down

0 comments on commit c468f62

Please sign in to comment.