当前位置:网站首页>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())
边栏推荐
猜你喜欢

Nlp-d62-nlp competition d31 & question brushing D15

Run opcua protocol demo on raspberry pie 4B to access kubeedge

Thinking technology: how to solve the dilemma in work and life?

NLP-D62-nlp比赛D31&刷题D15

Information System Project Manager - Chapter VII project cost management

JVM object composition and storage

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

Proxy reflect usage details

How to check the frequency of memory and the number of memory slots in CPU-Z?

Create a basic WDM driver and use MFC to call the driver
随机推荐
Database - index
机 器 学 习
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)
openstack实例重启状态就会变成错误处理方法,容器搭建的openstack重启计算节点compute服务方法,开机提示Give root password for maintenance处理方法
高斯分布Gaussian distribution、線性回歸、邏輯回歸logistics regression
Multithreading basic part2
Functional continuous
JVM garbage collection mechanism
Webrtc series - Nomination and ice of 7-ice supplement for network transmission_ Model
Sqlsever 字段相乘后保留2位小数
JVM class loading mechanism
多线程基础部分Part3
426 binary tree (513. find the value in the lower left corner of the tree, 112. sum of paths, 106. construct a binary tree from the middle order and post order traversal sequence, 654. maximum binary
JS to implement bidirectional data binding
资深【软件测试工程师】学习线路和必备知识点
汇编语言-王爽 第9章 转移指令的原理-笔记
代码即数据
线程间等待与唤醒机制、单例模式、阻塞队列、定时器
使用CSDN 开发云搭建导航网站
tracepoint