Created
September 11, 2011 23:42
-
-
Save coderunner/1210300 to your computer and use it in GitHub Desktop.
abstract logger
This file contains hidden or 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 abstract class Logger | |
| { | |
| private final String name; | |
| private int logCount = 0; | |
| public Logger(String name) | |
| { | |
| this.name = name; | |
| } | |
| public int getLogCount() | |
| { | |
| return logCount; | |
| } | |
| public void log(Level level, String message) | |
| { | |
| log(formatLog(level, message)); | |
| ++logCount; | |
| } | |
| protected String formatLog(Level level, String message) | |
| { | |
| return name + " - "+ level +" : "+message; | |
| } | |
| protected abstract void log(String formattedLog); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment