Logger
Essentially a logger adapter for some usefull methods.
// There are a few constructures you can choose from.
Logger logger = new Logger("com.package", "prefix");
logger.info("Hello there!");
<root_format> prefix Hello there!
Features
Logger processLogger = logger.extend(" [Process]");
processLogger.info("Something is running.");
<root_format> [Log] [Process] Something is running.
logger.setLevel(Level.DEBUG);
logger.debug("Some info about what's going on.");
Sometimes your root logger won't let you see these messages. You have two options.
Change the root logger
Logger.setRootLoggerLevel(Level.DEBUG);
Send debug messages through Info
// This will still check if the level is DEBUG.
// However, when it sends it, it will be through info so you dont
// have to change the root logger.
// Remember the root logger may be used by a lot more than just your software.
logger.setDebugForwarding(true);
Last updated