printf_log_nonewline("[%s] ", log_token);
}
-static void Log(int log_level, char *mode, char *format, va_list ap)
+static void vLog(int log_level, char *mode, char *format, va_list ap)
{
if (log_level < 0 || log_level > LOG_FATAL)
return;
+ if (log_level == LOG_DEBUG)
+ {
+ if (!options.debug)
+ return;
+
+ // if optional debug mode specified, limit debug output accordingly
+ if (options.debug_mode != NULL &&
+ strstr(mode, options.debug_mode) == NULL)
+ return;
+ }
+
#if defined(PLATFORM_ANDROID)
android_log_prio = (log_level == LOG_DEBUG ? ANDROID_LOG_DEBUG :
log_level == LOG_INFO ? ANDROID_LOG_INFO :
{
va_list ap;
- if (!options.debug)
- return;
-
- // if optional debug mode specified, limit debug output accordingly
- if (options.debug_mode != NULL &&
- !strEqual(options.debug_mode, mode))
- return;
-
va_start(ap, format);
- Log(LOG_DEBUG, mode, format, ap);
+ vLog(LOG_DEBUG, mode, format, ap);
va_end(ap);
}
va_list ap;
va_start(ap, format);
- Log(LOG_INFO, NULL, format, ap);
+ vLog(LOG_INFO, NULL, format, ap);
va_end(ap);
}
va_list ap;
va_start(ap, format);
- Log(LOG_WARN, NULL, format, ap);
+ vLog(LOG_WARN, NULL, format, ap);
va_end(ap);
}
while (node)
{
- printf("['%s' (%d)]\n", node->key,
- ((struct ListNodeInfo *)node->content)->num_references);
+ Debug("internal:dumpList", "['%s' (%d)]", node->key,
+ ((struct ListNodeInfo *)node->content)->num_references);
node = node->next;
}
- printf("[%d nodes]\n", getNumNodes(node_first));
+ Debug("internal:dumpList", "[%d nodes]", getNumNodes(node_first));
}
#endif
counter[counter_nr][1] = counter[counter_nr][0];
if (message)
- Error(ERR_DEBUG, "%s%s%s %.3f %s",
- debug_print_timestamp_get_padding(counter_nr * indent_size),
- message,
- debug_print_timestamp_get_padding(padding_size - strlen(message)),
- timestamp_interval / 1000,
- unit);
+ Debug("time", "%s%s%s %.3f %s",
+ debug_print_timestamp_get_padding(counter_nr * indent_size),
+ message,
+ debug_print_timestamp_get_padding(padding_size - strlen(message)),
+ timestamp_interval / 1000,
+ unit);
}
#if 0