C / C++
https://www.cnblogs.com/develon/p/7845880.html
日志
#include <android/log.h>
#define R(x) #x
#define STR(x) R(x)
#define LOG(...) __android_log_print(ANDROID_LOG_DEBUG, __FILE_NAME__ ":" STR(__LINE__), ##__VA_ARGS__)
#define TLOG(tag, fmt, ...) __android_log_print(ANDROID_LOG_DEBUG, __FILE_NAME__ ":" STR(__LINE__), "%s -> " fmt, tag, ##__VA_ARGS__)
#define FLOG(fmt, ...) TLOG(__func__, fmt, ##__VA_ARGS__)
LOG("The value of 1 + 1 is %d", 1+1);
输出:
2023-05-27 19:03:22.609 12721-12721/app.tcp2ws D/native-lib.cpp:27: The value of 1 + 1 is 2
标签:__,VA,LOG,fmt,ARGS,汇总,技巧,语言,define
From: https://www.cnblogs.com/develon/p/17455968.html