![]() |
GHOST
1.1.2
General, Hybrid, and Optimized Sparse Toolkit
|
Macros for logging. More...
#include "config.h"#include <stdio.h>#include <string.h>

Go to the source code of this file.
Macros | |
| #define | GHOST_ANSI_COLOR_RED "\x1b[31m" |
| #define | GHOST_ANSI_COLOR_GREEN "\x1b[32m" |
| #define | GHOST_ANSI_COLOR_YELLOW "\x1b[33m" |
| #define | GHOST_ANSI_COLOR_BLUE "\x1b[34m" |
| #define | GHOST_ANSI_COLOR_MAGENTA "\x1b[35m" |
| #define | GHOST_ANSI_COLOR_CYAN "\x1b[36m" |
| #define | GHOST_ANSI_COLOR_RESET "\x1b[0m" |
| #define | GHOST_IF_DEBUG(level) if(GHOST_VERBOSITY > level) |
| #define | GHOST_FILE_BASENAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) |
| #define | GHOST_FIRST(...) GHOST_FIRST_HELPER(__VA_ARGS__, throwaway) |
| #define | GHOST_FIRST_HELPER(first,...) first |
| #define | REST(...) REST_HELPER(NUM(__VA_ARGS__), __VA_ARGS__) |
| #define | REST_HELPER(qty,...) REST_HELPER2(qty, __VA_ARGS__) |
| #define | REST_HELPER2(qty,...) REST_HELPER_##qty(__VA_ARGS__) |
| #define | REST_HELPER_ONE(first) |
| #define | REST_HELPER_TWOORMORE(first,...) , __VA_ARGS__ |
| #define | NUM(...) |
| #define | SELECT_20TH(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20,...) a20 |
| #define | GHOST_LOG(type, color,...) |
| #define | GHOST_DEBUG_LOG(level,...) {if(GHOST_VERBOSITY > level) { GHOST_LOG(DEBUG,GHOST_ANSI_COLOR_RESET,__VA_ARGS__) }} |
| #define | GHOST_INFO_LOG(...) {if (GHOST_VERBOSITY) { GHOST_LOG(INFO,GHOST_ANSI_COLOR_BLUE,__VA_ARGS__); }} |
| #define | GHOST_WARNING_LOG(...) {if (GHOST_VERBOSITY) { GHOST_LOG(WARNING,GHOST_ANSI_COLOR_YELLOW,__VA_ARGS__); }} |
| #define | GHOST_PERFWARNING_LOG(...) {if (GHOST_VERBOSITY) { GHOST_LOG(PERFWARNING,GHOST_ANSI_COLOR_MAGENTA,__VA_ARGS__); }} |
| #define | GHOST_ERROR_LOG(...) {if (GHOST_VERBOSITY) { GHOST_LOG(ERROR,GHOST_ANSI_COLOR_RED,__VA_ARGS__); }} |
Macros for logging.
| #define GHOST_ANSI_COLOR_BLUE "\x1b[34m" |
| #define GHOST_ANSI_COLOR_CYAN "\x1b[36m" |
| #define GHOST_ANSI_COLOR_GREEN "\x1b[32m" |
| #define GHOST_ANSI_COLOR_MAGENTA "\x1b[35m" |
| #define GHOST_ANSI_COLOR_RED "\x1b[31m" |
| #define GHOST_ANSI_COLOR_RESET "\x1b[0m" |
| #define GHOST_ANSI_COLOR_YELLOW "\x1b[33m" |
| #define GHOST_DEBUG_LOG | ( | level, | |
| ... | |||
| ) | {if(GHOST_VERBOSITY > level) { GHOST_LOG(DEBUG,GHOST_ANSI_COLOR_RESET,__VA_ARGS__) }} |
| #define GHOST_ERROR_LOG | ( | ... | ) | {if (GHOST_VERBOSITY) { GHOST_LOG(ERROR,GHOST_ANSI_COLOR_RED,__VA_ARGS__); }} |
| #define GHOST_FILE_BASENAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) |
| #define GHOST_FIRST | ( | ... | ) | GHOST_FIRST_HELPER(__VA_ARGS__, throwaway) |
| #define GHOST_FIRST_HELPER | ( | first, | |
| ... | |||
| ) | first |
| #define GHOST_IF_DEBUG | ( | level | ) | if(GHOST_VERBOSITY > level) |
| #define GHOST_INFO_LOG | ( | ... | ) | {if (GHOST_VERBOSITY) { GHOST_LOG(INFO,GHOST_ANSI_COLOR_BLUE,__VA_ARGS__); }} |
| #define GHOST_LOG | ( | type, | |
| color, | |||
| ... | |||
| ) |
| #define GHOST_PERFWARNING_LOG | ( | ... | ) | {if (GHOST_VERBOSITY) { GHOST_LOG(PERFWARNING,GHOST_ANSI_COLOR_MAGENTA,__VA_ARGS__); }} |
| #define GHOST_WARNING_LOG | ( | ... | ) | {if (GHOST_VERBOSITY) { GHOST_LOG(WARNING,GHOST_ANSI_COLOR_YELLOW,__VA_ARGS__); }} |
| #define NUM | ( | ... | ) |
| #define REST | ( | ... | ) | REST_HELPER(NUM(__VA_ARGS__), __VA_ARGS__) |
| #define REST_HELPER | ( | qty, | |
| ... | |||
| ) | REST_HELPER2(qty, __VA_ARGS__) |
| #define REST_HELPER2 | ( | qty, | |
| ... | |||
| ) | REST_HELPER_##qty(__VA_ARGS__) |
| #define REST_HELPER_ONE | ( | first | ) |
| #define REST_HELPER_TWOORMORE | ( | first, | |
| ... | |||
| ) | , __VA_ARGS__ |
| #define SELECT_20TH | ( | a1, | |
| a2, | |||
| a3, | |||
| a4, | |||
| a5, | |||
| a6, | |||
| a7, | |||
| a8, | |||
| a9, | |||
| a10, | |||
| a11, | |||
| a12, | |||
| a13, | |||
| a14, | |||
| a15, | |||
| a16, | |||
| a17, | |||
| a18, | |||
| a19, | |||
| a20, | |||
| ... | |||
| ) | a20 |
1.8.6