StaticLog

Static Call Log - StaticLog

Origin

Many times, we just want to simply use logging, preferably with a single method. We don’t want to create a Log object. In that case, StaticLog may be what you need.

Usage

StaticLog.info("This is static {} log.", "INFO");

Similarly, StaticLog provides trace, debug, info, warn, and error methods, supporting variable placeholders to make logging in the project simple and effortless.

The StaticLog class also provides a log method, which may offer excellent flexibility in an extremely concise situation (the logging level to be printed is determined by the level parameter).

Methods with the Same Name as LogFactory

What if you only know about StaticLog and not LogFactory? Hutool kindly provides the get method, which works the same as the get method in LogFactory and can also obtain a Log object.