当前位置:网站首页>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())
边栏推荐
- 美摄云服务方案:专为轻量化视频制作场景打造
- Redis4.0新特性-主动内存碎片整理
- 【Cocos Creator 3.5.1】input.on的使用
- Sqlsever 字段相乘后保留2位小数
- Wechat applet refreshes the current page
- The SCP command is used in the expect script. The perfect solution to the problem that the SCP command in the expect script cannot obtain the value
- 下载cuda和cudnn
- Neon optimization 1: how to optimize software performance and reduce power consumption?
- 【Cocos Creator 3.5.1】event.getButton()的使用
- Openresty usage document
猜你喜欢

【QT小作】使用结构体数据生成读写配置文件代码

Small program of C language practice (consolidate and deepen the understanding of knowledge points)

多线程基础部分Part 1

Proxy reflect usage details

JVM对象组成和存储
![Navigation [machine learning]](/img/79/8311a409113331e72f650a83351b46.png)
Navigation [machine learning]

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

openresty使用文档

Double position relay rxmd2-1mrk001984 dc220v

JVM类加载机制
随机推荐
表单校验 v-model 绑定的变量,校验失效的解决方案
日期 数据库日期 字符串 之间互相转换
Assembly language - Wang Shuang Chapter 13 int instruction - Notes
Redis4.0新特性-主动内存碎片整理
Download CUDA and cudnn
创建一个基础WDM驱动,并使用MFC调用驱动
The SCP command is used in the expect script. The perfect solution to the problem that the SCP command in the expect script cannot obtain the value
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)
【合辑】点云基础知识及点云催化剂软件功能介绍
Using CSDN to develop cloud and build navigation websites
Navigation [machine learning]
Code is data
JVM tuning ideas
G1和ZGC垃圾收集器
Force buckle 179, max
Change the status to the corresponding text during MySQL query
Multithreading basic Part3
C语言练手小项目(巩固加深知识点理解)
多线程基础部分Part 1
693. alternate bit binary number