#ifdef _RELEASE #define ANY_LOG_FORMAT_BEFORE(stream, level, context, module, func) \ fprintf(stream, "[%s%s%s%s%s%s%s] %s%s%s: ", \ ANY_LOG_COLOR_GET(ANY_LOG_COLOR_CONTEXT), context, ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), *context ? " " : "", \ ANY_LOG_COLOR_GET(ANY_LOG_COLOR_MODULE), *func ? func : module, ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), \ ANY_LOG_COLOR_GET(level), any_log_level_strings[level], ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET)) #define ANY_LOG_VALUE_BEFORE(stream, level, context, module, func, message) \ fprintf(stream, "[%s%s%s%s%s%s%s] %s%s%s: %s [", \ ANY_LOG_COLOR_GET(ANY_LOG_COLOR_CONTEXT), context, ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), *context ? " " : "", \ ANY_LOG_COLOR_GET(ANY_LOG_COLOR_MODULE), *func ? func : module, ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), \ ANY_LOG_COLOR_GET(level), any_log_level_strings[level], ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), message) #else #define ANY_LOG_FORMAT_BEFORE(stream, level, context, module, func) \ fprintf(stream, "[%s%s%s%s%s%s%s%s%s%s%s] %s%s%s: ", \ ANY_LOG_COLOR_GET(ANY_LOG_COLOR_CONTEXT), context, ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), *context ? " " : "", \ ANY_LOG_COLOR_GET(ANY_LOG_COLOR_MODULE), module, ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), *func ? " " : "", \ ANY_LOG_COLOR_GET(ANY_LOG_COLOR_FUNC), func, ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), \ ANY_LOG_COLOR_GET(level), any_log_level_strings[level], ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET)) #define ANY_LOG_VALUE_BEFORE(stream, level, context, module, func, message) \ fprintf(stream, "[%s%s%s%s%s%s%s%s%s%s%s] %s%s%s: %s [", \ ANY_LOG_COLOR_GET(ANY_LOG_COLOR_CONTEXT), context, ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), *context ? " " : "", \ ANY_LOG_COLOR_GET(ANY_LOG_COLOR_MODULE), module, ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), *func ? " " : "", \ ANY_LOG_COLOR_GET(ANY_LOG_COLOR_FUNC), func, ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), \ ANY_LOG_COLOR_GET(level), any_log_level_strings[level], ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), message) #endif #define ANY_LOG_VALUE_STRING(stream, key, value) \ fprintf(stream, "%s=\"%s\"", key, value ? value : "(null)") #define ANY_LOG_COLOR_CONTEXT_DEFAULT "\x1b[34m" #define ANY_LOG_IMPLEMENT #include "log.h"