Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enter logger definition in IntelliJ fast?

Are there some live template or something, to add logger definition into a class?

In Eclipse I had a template:

private static final Logger log = LoggerFactory.getLogger(${enclosing_type}.class);

Don't see something about this in Log Support plugin.

like image 755
Dims Avatar asked Aug 17 '15 20:08

Dims


1 Answers

Using Intellij Live Template:

Settings -> Editor -> Live Templates

Setting like bellow:

private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger($CLASSNAME$.class);

enter image description here

To expand a code snippet, type "logger" and press Tab

like image 70
huytmb Avatar answered Oct 27 '22 07:10

huytmb