print color:
- static const int DEBUG_LEVEL_COLORS[] = {
-
/*Errors Normal Info Detail Calls Detail2 Detail3 */
-
31/*red*/, 0/*normal*/, 32/*green*/, 33/*yellow*/, 36/*cyan*/, 35/*magenta*/, 4/*Underline*/};
-
printf("\033[%dm", DEBUG_LEVEL_COLORS[0]);
-
-
if (use_color)
-
printf("\033[0m");
----------------
print indent info:
DEBUG_CALLED("\"%s\"", remote_spec);
-----------
OCTEON_REMOTE: Called octeon_remote_open("LINUX")
-----------
#define DEBUG_CALLED(format, ...) \
remote_debug_call(0, "Called %s(" format ")\n", __FUNCTION__, ##__VA_ARGS__);
void debug_call(int is_return, const char *format, ...)
{
if (3 <= remote_funcs.debug)
{
va_list args;
if (is_return)
remote_funcs.debug_indent--;
printf("victor:%*s", (remote_funcs.debug_indent+1)*2, "");
va_start(args, format);
vprintf(format, args);
va_end(args);
if (!is_return)
remote_funcs.debug_indent++;
}
}
阅读(987) | 评论(0) | 转发(0) |