Created
March 4, 2014 14:37
-
-
Save frankely/9347619 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LoggerHelper { | |
private Logger logger; | |
private LoggerHelper(Class clazz) { | |
logger = Logger.getLogger(clazz); | |
} | |
public static LoggerHelper createLogger(Class clazz) { | |
return new LoggerHelper(clazz); | |
} | |
public void info(String info, String... formats) { | |
if (formats != null) { | |
info = String.format(info, formats); | |
} | |
logger.info(info); | |
} | |
public void warning(String warning, String... formats) { | |
if (formats != null) { | |
warning = String.format(warning, formats); | |
} | |
logger.warn(warning); | |
} | |
public void severe(String severe, String... formats) { | |
if (formats != null) { | |
severe = String.format(severe, formats); | |
} | |
logger.warn(severe); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment