当前位置:网站首页>C language, log print file name, function name, line number, date and time
C language, log print file name, function name, line number, date and time
2022-07-06 11:58:00 【Weiyuan escort agency】
• __LINE__: Insert the current source line number in the source code
• __FILE__: Insert the current source file name... In the source file
• __FUNCTION__: Function name
• __DATE__: Insert the current compile date... In the source file
• __TIME__: Insert the current compile time... In the source file
C Language use printf(“filename:%s”, FILE); Print file name , If it is found, the directory where the file is located will also be printed out
#include <string.h> //strrchr() The header file required by the function
//windows:
#define filename(x) strrchr(x,'\\')?strrchr(x,'\\')+1:x
//linux :
#define filename(x) strrchr(x,'/')?strrchr(x,'/')+1:x
printf( "filename:%s\n", filename( __FILE__ ) );
边栏推荐
- [Flink] cdh/cdp Flink on Yan log configuration
- 使用LinkedHashMap实现一个LRU算法的缓存
- 2019腾讯暑期实习生正式笔试
- Encodermappreduce notes
- Yarn installation and use
- 【CDH】CDH/CDP 环境修改 cloudera manager默认端口7180
- RT-Thread API参考手册
- Vert. x: A simple TCP client and server demo
- L2-001 emergency rescue (25 points)
- 4、安装部署Spark(Spark on Yarn模式)
猜你喜欢
随机推荐
[Blue Bridge Cup 2017 preliminary] buns make up
L2-001 emergency rescue (25 points)
选择法排序与冒泡法排序【C语言】
Principle and implementation of MySQL master-slave replication
分布式节点免密登录
[CDH] modify the default port 7180 of cloudera manager in cdh/cdp environment
Vert. x: A simple login access demo (simple use of router)
Correspondence between STM32 model and contex M
高通&MTK&麒麟 手機平臺USB3.0方案對比
Redis interview questions
SQL time injection
Stage 4 MySQL database
Reading notes of difficult career creation
2019腾讯暑期实习生正式笔试
Apprentissage automatique - - régression linéaire (sklearn)
电商数据分析--薪资预测(线性回归)
Dependency in dependencymanagement cannot be downloaded and red is reported
L2-007 family real estate (25 points)
[Presto] Presto parameter configuration optimization
【CDH】CDH5.16 配置 yarn 任务集中分配设置不生效问题