changeset 356:0f868bb629f5 draft

Improvements of the logger class.
author Pavel Tisnovsky <ptisnovs@redhat.com>
date Wed, 14 May 2014 11:10:19 +0200
parents 80ea8e60703a
children 5f9eba77856c
files ChangeLog src/org/RhinoTests/Log.java
diffstat 2 files changed, 55 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue May 13 10:51:09 2014 +0200
+++ b/ChangeLog	Wed May 14 11:10:19 2014 +0200
@@ -1,3 +1,8 @@
+2014-05-14  Pavel Tisnovsky  <ptisnovs@redhat.com>
+
+	* src/org/RhinoTests/Log.java:
+	Improvements of the logger class.
+
 2014-05-13  Pavel Tisnovsky  <ptisnovs@redhat.com>
 
 	* src/org/RhinoTests/Log.java:
--- a/src/org/RhinoTests/Log.java	Tue May 13 10:51:09 2014 +0200
+++ b/src/org/RhinoTests/Log.java	Wed May 14 11:10:19 2014 +0200
@@ -39,5 +39,55 @@
 */
 
 class Log {
+
+    /**
+     * Set of colors for colorized output to the terminal.
+     */
+    static Map<String, String> colors = new HashMap<String, String>(10);
+
+    static
+    {
+        colors.put( "RED", "31" );
+        colors.put( "GREEN", "32" );
+        colors.put( "ORANGE", "33" );
+        colors.put( "BLUE", "34" );
+        colors.put( "VIOLET", "35" );
+        colors.put( "MAGENTA", "35" );
+        colors.put( "LIGHT_BLUE", "36" );
+        colors.put( "GRAY", "38" );
+        colors.put( "GREY", "38" );
+    }
+
+    /**
+     * Actual amount of indentation.
+     */
+    private int indent = 0;
+
+    /**
+     * How much spaces should be added/removed for each level?
+     */
+    private int indentDelta = 4;
+
+    /**
+     * Class name used by logger.
+     */
+    private String className = null;
+
+    /**
+     * Implicit constructor.
+     */
+    public Log()
+    {
+        this.className = "unknown";
+    }
+
+    /**
+     * Explicit constructor that initializes class name.
+     */
+    public Log(String className)
+    {
+        this.className = className;
+    }
+
 }