Skip to content

Commit

Permalink
adaptived: log: Delete superfluous log messages
Browse files Browse the repository at this point in the history
Don't output "Error: ", "Debug: ", etc. messages to the requested log.
When logging to journalctl, they result in an extra line of noise that
pollutes the log.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
  • Loading branch information
drakenclimber committed Jan 6, 2025
1 parent 85f08fd commit fdb316b
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions adaptived/src/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,11 @@ static void _log(int priority, const char *fmt, va_list *ap)
va_end(*ap);
}

static void _log_string(int priority, const char *fmt, ...)
{
va_list ap;

va_start(ap, fmt);
_log(priority, fmt, &ap);
va_end(ap);
}

API void adaptived_err(const char *fmt, ...)
{
va_list ap;

if (log_level >= LOG_ERR) {
_log_string(LOG_ERR, "Error: ");
va_start(ap, fmt);
_log(LOG_ERR, fmt, &ap);
va_end(ap);
Expand All @@ -84,7 +74,6 @@ API void adaptived_wrn(const char *fmt, ...)
va_list ap;

if (log_level >= LOG_WARNING) {
_log_string(LOG_WARNING, "Warning: ");
va_start(ap, fmt);
_log(LOG_WARNING, fmt, &ap);
va_end(ap);
Expand All @@ -96,7 +85,6 @@ API void adaptived_info(const char *fmt, ...)
va_list ap;

if (log_level >= LOG_INFO) {
_log_string(LOG_INFO, "Info: ");
va_start(ap, fmt);
_log(LOG_INFO, fmt, &ap);
va_end(ap);
Expand All @@ -108,7 +96,6 @@ API void adaptived_dbg(const char *fmt, ...)
va_list ap;

if (log_level >= LOG_DEBUG) {
_log_string(LOG_DEBUG, "Debug: ");
va_start(ap, fmt);
_log(LOG_DEBUG, fmt, &ap);
va_end(ap);
Expand Down

0 comments on commit fdb316b

Please sign in to comment.