package bridlensis;

import java.io.PrintStream;

public class Logger {

	private static final int ERROR = 4;
	private static final int WARN = 3;
	private static final int INFO = 2;
	private static final int DEBUG = 1;

	private static Logger instance = null;

	public static Logger getInstance() {
		if (instance == null) {
			instance = new Logger();
		}
		return instance;
	}

	private PrintStream output;
	private int level;

	private Logger() {
		output = System.out;
		level = INFO;
	}

	public void setPrintStream(PrintStream printStream) {
		output = printStream;
	}

	private void log(int level, String msg) {
		if (level >= this.level) {
			output.println(msg);
		}
	}

	public void error(BridleNSISException e) {
		log(ERROR, e.getMessage());
	}

	public void warn(InputReader reader, String message) {
		warn(String.format("%s, line %d: %s", reader.getFile(),
				reader.getLinesRead(), message));
	}

	public void warn(String message) {
		log(WARN, message);
	}

	public void info(String message) {
		log(INFO, message);
	}

	public void info(InputReader reader, String message) {
		info(String.format("%s, line %d: %s", reader.getFile(),
				reader.getLinesRead(), message));
	}

	public void debug(String message) {
		log(DEBUG, message);
	}

	public void debug(InputReader reader, String message) {
		debug(String.format("%s, line %d: %s", reader.getFile(),
				reader.getLinesRead(), message));
	}

}

@@ -70,30 +70,29 @@
 gger %7B%0D%0A%0D%0A%09p
-rivate
+ublic
  static fina
@@ -109,20 +109,19 @@
 R = 
-4
+0
 ;%0D%0A%09p
-rivate
+ublic
  sta
@@ -145,20 +145,19 @@
 N = 
-3
+1
 ;%0D%0A%09p
-rivate
+ublic
  sta
@@ -179,30 +179,29 @@
 NFO = 2;%0D%0A%09p
-rivate
+ublic
  static fina
@@ -214,17 +214,17 @@
 DEBUG = 
-1
+3
 ;%0D%0A%0D%0A%09pr
@@ -589,32 +589,100 @@
 tStream;%0D%0A%09%7D%0D%0A%0D%0A
+%09public void setLogLevel(int level) %7B%0D%0A%09%09this.level = level;%0D%0A%09%7D%0D%0A%0D%0A
 %09private void lo
@@ -725,9 +725,9 @@
 vel 
-%3E
+%3C
 = th

Change the log levels so that ERROR = lowest(0) and DEBUG = highest(3).