当前位置:网站首页>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())
边栏推荐
- 高斯分布Gaussian distribution、線性回歸、邏輯回歸logistics regression
- Multithreading basic Part3
- Free SSH and telnet client putty
- Wechat applet refreshes the current page
- JVM class loading mechanism
- tracepoint
- [FPGA] UART serial port_ V1.1
- 【Cocos Creator 3.5.1】event. Use of getbutton()
- Implementation of easyexcel's function of merging cells with the same content and dynamic title
- WebRTC系列-网络传输之7-ICE补充之提名(nomination)与ICE_Model
猜你喜欢

Openresty usage document

Us camera cloud service scheme: designed for lightweight video production scenes

开门小例子学习十种用例图

JVM对象组成和存储

How win 10 opens the environment variables window

Using domain name forwarding mqtt protocol, pit avoidance Guide
![[FPGA] design and implementation of frequency division and doubling based on FPGA](/img/84/75d473d3d8e670260ba16d06705c2f.png)
[FPGA] design and implementation of frequency division and doubling based on FPGA

主动学习(active learning)

多线程带来的的风险——线程安全

30 SCM common problems and solutions!
随机推荐
How win 10 opens the environment variables window
G1 and ZGC garbage collector
Netease cloud music params and encseckey parameter generation code
JVM common instructions
Neon optimization 1: how to optimize software performance and reduce power consumption?
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
G1和ZGC垃圾收集器
Multithreading basic part2
Webrtc Series - Network Transport 7 - ice Supplement nominations and ice Modèle
Change the status to the corresponding text during MySQL query
Win 10 如何打开环境变量窗口
Two position relay hjws-9440
693. alternate bit binary number
【QT小记】QT元对象系统简单认识
【养成系】常用正则表达式
Spark's projection
Open the door small example to learn ten use case diagrams
Dual position relay dls-34a dc0.5a 220VDC
信息系统项目管理师---第七章 项目成本管理
[FPGA] design and implementation of frequency division and doubling based on FPGA