diff src/goodjava/logger/Level.java @ 1448:6fc083e1d08c

start logger
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 23 Feb 2020 18:14:32 -0700
parents
children dd14d2dce7ee
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/goodjava/logger/Level.java	Sun Feb 23 18:14:32 2020 -0700
@@ -0,0 +1,23 @@
+package goodjava.logger;
+
+
+final class Level {
+	public final static int DEBUG = 0;
+	public final static int INFO = 1;
+	public final static int WARN = 2;
+	public final static int ERROR = 3;
+	public final static int OFF = 4;
+
+	private static final String[] names = {"DEBUG","INFO","WARN","ERROR"};
+
+	public static String toString(int level) {
+		return names[level];
+	}
+
+	private static final String[] paddedNames = {"DEBUG","INFO ","WARN ","ERROR"};
+
+	public static String toPaddedString(int level) {
+		return paddedNames[level];
+	}
+
+}