/hg/rhino-tests: Improvements of the logger class.

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Wed May 14 09:09:32 UTC 2014


changeset 0f868bb629f5 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=0f868bb629f5
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed May 14 11:10:19 2014 +0200

	Improvements of the logger class.


diffstat:

 ChangeLog                   |   5 ++++
 src/org/RhinoTests/Log.java |  50 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 0 deletions(-)

diffs (71 lines):

diff -r 80ea8e60703a -r 0f868bb629f5 ChangeLog
--- 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 at redhat.com>
+
+	* src/org/RhinoTests/Log.java:
+	Improvements of the logger class.
+
 2014-05-13  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/Log.java:
diff -r 80ea8e60703a -r 0f868bb629f5 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;
+    }
+
 }
 


More information about the distro-pkg-dev mailing list