Skip to content

Instantly share code, notes, and snippets.

@coderunner
Created September 11, 2011 23:42
Show Gist options
  • Select an option

  • Save coderunner/1210300 to your computer and use it in GitHub Desktop.

Select an option

Save coderunner/1210300 to your computer and use it in GitHub Desktop.

Revisions

  1. coderunner created this gist Sep 11, 2011.
    28 changes: 28 additions & 0 deletions gistfile1.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    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);
    }