当前位置:网站首页>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__ ) );
边栏推荐
- Basic knowledge of lithium battery
- FTP文件上传文件实现,定时扫描文件夹上传指定格式文件文件到服务器,C语言实现FTP文件上传详解及代码案例实现
- ESP8266通过Arduino IDE连接Onenet云平台(MQTT)
- Reading notes of difficult career creation
- Vert. x: A simple login access demo (simple use of router)
- [NPUCTF2020]ReadlezPHP
- Hutool中那些常用的工具类和方法
- 互联网协议详解
- 机器学习--决策树(sklearn)
- Password free login of distributed nodes
猜你喜欢

sklearn之feature_extraction.text.CountVectorizer / TfidVectorizer

优先级反转与死锁

Kaggle竞赛-Two Sigma Connect: Rental Listing Inquiries

分布式節點免密登錄

几个关于指针的声明【C语言】

Apprentissage automatique - - régression linéaire (sklearn)

Variable star user module

【CDH】CDH5.16 配置 yarn 任务集中分配设置不生效问题

Mall project -- day09 -- order module

分布式事务的实现方案
随机推荐
arduino获取随机数
高通&MTK&麒麟 手机平台USB3.0方案对比
R & D thinking 01 ----- classic of embedded intelligent product development process
GNN的第一个简单案例:Cora分类
MySQL数据库面试题
[yarn] CDP cluster yarn configuration capacity scheduler batch allocation
优先级反转与死锁
[Bluebridge cup 2020 preliminary] horizontal segmentation
L2-001 emergency rescue (25 points)
Togglebutton realizes the effect of switching lights
Password free login of distributed nodes
Vert. x: A simple login access demo (simple use of router)
FTP文件上传文件实现,定时扫描文件夹上传指定格式文件文件到服务器,C语言实现FTP文件上传详解及代码案例实现
Dependency in dependencymanagement cannot be downloaded and red is reported
inline详细讲解【C语言】
【presto】presto 参数配置优化
List and set
[mrctf2020] dolls
Mall project -- day09 -- order module
Variable star user module