当前位置:网站首页>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())
边栏推荐
- cpu-z中如何查看内存的频率和内存插槽的个数?
- JVM overall structure analysis
- Open the door small example to learn ten use case diagrams
- Altium designer 19 device silk screen label position shall be placed uniformly in batches
- 【Cocos Creator 3.5.1】this. node. Use of getposition (this.\u curpos)
- mysql 查询时将状态改为相对应的文字
- 开门小例子学习十种用例图
- Database - index
- How to check the frequency of memory and the number of memory slots in CPU-Z?
- JVM garbage collection mechanism
猜你喜欢

Dev++ environment setting C language keyword display color

Small program of C language practice (consolidate and deepen the understanding of knowledge points)
![Navigation [machine learning]](/img/79/8311a409113331e72f650a83351b46.png)
Navigation [machine learning]

美摄云服务方案:专为轻量化视频制作场景打造

Proxy reflect usage details

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

JVM的垃圾回收机制

Assembly language - Wang Shuang Chapter 13 int instruction - Notes

使用CSDN 开发云搭建导航网站

Program ape learning Tiktok short video production
随机推荐
思维的技术:如何破解工作生活中的两难冲突?
多线程基础部分Part3
Functional continuous
Assembly language - Wang Shuang Chapter 13 int instruction - Notes
IAR systems fully supports Centrino technology 9 series chips
Software testing year end summary report template
Dev++ 环境设置C语言关键字显示颜色
426-二叉树(513.找树左下角的值、112. 路径总和、106.从中序与后序遍历序列构造二叉树、654. 最大二叉树)
汇编语言-王爽 第9章 转移指令的原理-笔记
DAST black box vulnerability scanner part 6: operation (final)
WebRTC系列-網絡傳輸之7-ICE補充之提名(nomination)與ICE_Model
My opinion on test team construction
The form verifies the variables bound to the V-model, and the solution to invalid verification
Jump details of item -h5 list, and realize the function of not refreshing when backing up, and refreshing when modifying data (record scroll bar)
Openresty usage document
古典密码体制--代换和置换
Go log -uber open source library zap use
【QT小点】实现看门狗功能,检测外部程序是否在运行
JVM常用指令
NLP-D62-nlp比赛D31&刷题D15