Skip to content

Instantly share code, notes, and snippets.

@behrangsa
Created June 4, 2011 02:58
Show Gist options
  • Save behrangsa/1007513 to your computer and use it in GitHub Desktop.
Save behrangsa/1007513 to your computer and use it in GitHub Desktop.
Logger
public class Logger {
private Level level = Level.WARNING;
public void setLevel(Level level) {
this.level = level;
}
public void log(Level level, { => String} message) {
if (this.level == level) {
String loggableMessage = message.invoke();
log(loggableMessage);
}
}
public void log(String message) {
System.out.println(message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment