#ifndef __DEBUG_H #define __DEBUG_H #include #include "process.h" extern const char red_color[]; extern const char green_color[]; extern const char normal_color[]; #define pr_info(fmt, arg...) \ do { \ char indent[16] = { " " }; \ indent[get_parent_count()] = 0; \ fprintf(stderr, "%s%s[%5d.%d] %s:%d %s" \ fmt, indent, green_color, \ getpid(), get_sibling_count(), \ __FILE__, __LINE__, normal_color, ##arg); \ } while (0) #define pr_err(fmt, arg...) \ do { \ char indent[16] = { " " }; \ indent[get_parent_count()] = 0; \ fprintf(stderr, "%s%s[%5d.%d] %s:%d Error %s" \ fmt, indent, red_color, \ getpid(), get_sibling_count(), \ __FILE__, __LINE__, normal_color, ##arg); \ } while (0) #endif