Skip to content

Commit

Permalink
Fix logger write
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik committed Aug 2, 2023
1 parent 0b3449b commit 5b8a871
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions dash-pipeline/SAI/templates/logger.cpp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,26 @@ void Logger::write(Priority prio, const char *fmt, ...)
if (prio > m_minPrio)
return;

va_list ap;
va_start(ap, fmt);
// print to syslog
{
va_list ap;
va_start(ap, fmt);

vsyslog(prio, fmt, ap); // print to syslog
vsyslog(prio, fmt, ap);

vfprintf(stderr, fmt, ap); // print to stderr
fprintf(stderr, "\n");
va_end(ap);
}

va_end(ap);
// print to stderr
{
va_list ap;
va_start(ap, fmt);

vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");

va_end(ap);
}
}

Logger::ScopeLogger::ScopeLogger(int line, const char *fun) : m_line(line), m_fun(fun)
Expand Down

0 comments on commit 5b8a871

Please sign in to comment.