Skip to content

Instantly share code, notes, and snippets.

@aviflax
Created January 18, 2012 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aviflax/1634459 to your computer and use it in GitHub Desktop.
Save aviflax/1634459 to your computer and use it in GitHub Desktop.
Some convenience methods I’d like to see added to java.util.logging.Logger
public void log(Level level, String message, Throwable throwable, Object... params) {
log(level, MessageFormat.format(message, params), throwable);
}
public void severe(String message, Throwable throwable) {
log(Level.SEVERE, message, throwable);
}
public void severe(String message, Object... params) {
log(Level.SEVERE, message, params);
}
public void severe(String message, Throwable throwable, Object... params) {
log(Level.SEVERE, MessageFormat.format(message, params), throwable);
}
public void warning(String message, Throwable throwable) {
log(Level.WARNING, message, throwable);
}
public void warning(String message, Object... params) {
log(Level.WARNING, message, params);
}
public void warning(String message, Throwable throwable, Object... params) {
log(Level.WARNING, MessageFormat.format(message, params), throwable);
}
public void info(String message, Throwable throwable) {
log(Level.INFO, message, throwable);
}
public void info(String message, Object... params) {
log(Level.INFO, message, params);
}
public void info(String message, Throwable throwable, Object... params) {
log(Level.INFO, MessageFormat.format(message, params), throwable);
}
public void fine(String message, Throwable throwable) {
log(Level.FINE, message, throwable);
}
public void fine(String message, Object... params) {
log(Level.FINE, message, params);
}
public void fine(String message, Throwable throwable, Object... params) {
log(Level.FINE, MessageFormat.format(message, params), throwable);
}
public void finer(String message, Throwable throwable) {
log(Level.FINER, message, throwable);
}
public void finer(String message, Object... params) {
log(Level.FINER, message, params);
}
public void finer(String message, Throwable throwable, Object... params) {
log(Level.FINER, MessageFormat.format(message, params), throwable);
}
public void finest(String message, Throwable throwable) {
log(Level.FINEST, message, throwable);
}
public void finest(String message, Object... params) {
log(Level.FINEST, message, params);
}
public void finest(String message, Throwable throwable, Object... params) {
log(Level.FINEST, MessageFormat.format(message, params), throwable);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment