C/C++ log 头文件
#pragma once
#include <stdio.h>
//#include <fmt/color.h>
//#include <fmt/format.h>
//fmt::print(fg(fmt::color::red), format, ##__VA_ARGS__); \
//fmt::print(fg(fmt::color::yellow), format, ##__VA_ARGS__); \
#define LOG_ERR(format, ...) \
do{ \
printf("\033[0m\033[1;31m" format "\033[0m", ##__VA_ARGS__); \
}while(0) \
#define LOG_WARN(format, ...) \
do{ \
printf("\033[0m\033[1;33m" format "\033[0m", ##__VA_ARGS__); \
}while(0)
#define LOG_INFO(format, ...) \
do{ \
printf(format, ##__VA_ARGS__); \
}while(0)
#include <stdio.h>
//#include <fmt/color.h>
//#include <fmt/format.h>
//fmt::print(fg(fmt::color::red), format, ##__VA_ARGS__); \
//fmt::print(fg(fmt::color::yellow), format, ##__VA_ARGS__); \
#define LOG_ERR(format, ...) \
do{ \
printf("\033[0m\033[1;31m" format "\033[0m", ##__VA_ARGS__); \
}while(0) \
#define LOG_WARN(format, ...) \
do{ \
printf("\033[0m\033[1;33m" format "\033[0m", ##__VA_ARGS__); \
}while(0)
#define LOG_INFO(format, ...) \
do{ \
printf(format, ##__VA_ARGS__); \
}while(0)
评论已关闭