当前位置:网站首页>IDEA一键生成Log日志
IDEA一键生成Log日志
2022-06-27 06:07:00 【Java小白笔记】
IDEA一键生成Log日志
通过IDEA live templates自动生成:
1、loge 异常日志打印
log.error($content$,$[params](https://so.csdn.net/so/search?q=params&spm=1001.2101.3001.7020)$);
content 参数:
groovyScript("def params = _2.collect {'【'+it+' = {}】'}.join(', '); return '\"' + _1 + '() called with exception => ' + (params.empty ? '' : params) + '\"'", methodName(), methodParameters())
params参数:
groovyScript("def params = _1.collect {it}.join(', '); return (params.empty ? '' : params) + ',e' ", methodParameters())

2、logi 参数日志打印
log.info($content$,$params$);
content参数:
groovyScript("def params = _2.collect {'【'+it+' = {}】'}.join(', '); return '\"' + _1 + '() called with parameters => ' + (params.empty ? '' : params) + '\"'", methodName(), methodParameters())
params参数:
groovyScript("def params = _1.collect {it}.join(', '); return (params.empty ? '' : params) ", methodParameters())
3、logr 结果日志打印
log.info("$METHOD_NAME$() returned: " + $result$);
METHOD_NAME参数:
methodName()
result参数:
variableOfType(methodReturnType())
边栏推荐
- 创建一个基础WDM驱动,并使用MFC调用驱动
- 【Cocos Creator 3.5.1】event. Use of getbutton()
- The restart status of the openstack instance will change to the error handling method. The openstack built by the container restarts the compute service method of the computing node and prompts the gi
- 函数栈帧的形成与释放
- Netease cloud music params and encseckey parameter generation code
- 《汇编语言-王爽》第3章笔记及实验
- 汇编语言-王爽 第13章 int指令-笔记
- 软件测试年终总结报告模板
- Thinking technology: how to solve the dilemma in work and life?
- 资深【软件测试工程师】学习线路和必备知识点
猜你喜欢

openstack实例重启状态就会变成错误处理方法,容器搭建的openstack重启计算节点compute服务方法,开机提示Give root password for maintenance处理方法

427- binary tree (617. merge binary tree, 700. search in binary search tree, 98. verify binary search tree, 530. minimum absolute difference of binary search tree)

Two position relay hjws-9440

Proxy-Reflect使用详解

信息系统项目管理师---第七章 项目成本管理

Altium Designer 19 器件丝印标号位置批量统一摆放

How win 10 opens the environment variables window

Crawler learning 5--- anti crawling identification picture verification code (ddddocr and pyteseract measured effect)

卷积神经网络---CNN模型的应用(找矿预测)

多线程基础部分Part 1
随机推荐
Dev++ 环境设置C语言关键字显示颜色
JVM garbage collection mechanism
The restart status of the openstack instance will change to the error handling method. The openstack built by the container restarts the compute service method of the computing node and prompts the gi
力扣 179、最大数
JVM调优思路
POI 替换docx中的文字和图片
我对于测试团队建设的意见
Redis4.0新特性-主动内存碎片整理
js实现双向数据绑定
JVM tuning ideas
Software testing year end summary report template
Built in functions of spark
Formation and release of function stack frame
【QT小点】实现看门狗功能,检测外部程序是否在运行
tracepoint
Kubesphere cluster configuration NFS storage solution - favorite
Functional continuous
IAR Systems全面支持芯驰科技9系列芯片
Program ape learning Tiktok short video production
Neon optimization 1: how to optimize software performance and reduce power consumption?