W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2010

unicorn commit: + log optimization

From: Mercurial notifier <nobody@w3.org>
Date: Mon, 02 Aug 2010 17:49:19 +0000
To: Unicorn Updates <www-validator-cvs@w3.org>
Message-Id: <E1Ofz8Z-00069U-Qq@blinky.w3.org>
changeset:   1418:6557c5d66152
user:        Thomas Gambet <tgambet@w3.org>
date:        Mon Aug 02 13:48:28 2010 -0400
files:       src/org/w3c/unicorn/action/ObserveAction.java
description:
+ log optimization


diff -r 6b7e764534c1 -r 6557c5d66152 src/org/w3c/unicorn/action/ObserveAction.java
--- a/src/org/w3c/unicorn/action/ObserveAction.java	Mon Aug 02 13:48:01 2010 -0400
+++ b/src/org/w3c/unicorn/action/ObserveAction.java	Mon Aug 02 13:48:28 2010 -0400
@@ -252,20 +252,22 @@
 			}
 		}
 		
-		String s = "Resolved parameters:";
-		for (String key : reqParams.keySet()) {
-			s += "\n\t" + key + " - ";
-			if (reqParams.get(key) instanceof String[]) {
-				s += "[";
-				for (int i = 0; i < ((String[]) reqParams.get(key)).length; i ++)
-					s += ((String[]) reqParams.get(key))[i] + ", ";
-				s = s.substring(0, s.length() - 2);
-				s += "]";
-			} else {
-				s += reqParams.get(key);
+		if (logger.isDebugEnabled()) {
+			String s = "Resolved parameters:";
+			for (String key : reqParams.keySet()) {
+				s += "\n\t" + key + " - ";
+				if (reqParams.get(key) instanceof String[]) {
+					s += "[";
+					for (int i = 0; i < ((String[]) reqParams.get(key)).length; i ++)
+						s += ((String[]) reqParams.get(key))[i] + ", ";
+					s = s.substring(0, s.length() - 2);
+					s += "]";
+				} else {
+					s += reqParams.get(key);
+				}
 			}
+			logger.debug(s);
 		}
-		logger.debug(s);
 		
 		// Launch the observation
 		try {
@@ -377,22 +379,24 @@
 			}
 		}
 		
-		String s = "Parameters: ";
-		for (String key : params.keySet()) {
-			s += "\n\t" + key + " - ";
-			if (params.get(key) instanceof String[]) {
-				s += "[";
-				for (int i = 0; i < ((String[]) params.get(key)).length; i ++) {
-					s += ((String[]) params.get(key))[i] + ", ";
+		if (logger.isDebugEnabled()) {
+			String s = "Parameters: ";
+			for (String key : params.keySet()) {
+				s += "\n\t" + key + " - ";
+				if (params.get(key) instanceof String[]) {
+					s += "[";
+					for (int i = 0; i < ((String[]) params.get(key)).length; i ++) {
+						s += ((String[]) params.get(key))[i] + ", ";
+					}
+					s = s.substring(0, s.length() - 2);
+					s += "]";
 				}
-				s = s.substring(0, s.length() - 2);
-				s += "]";
+				else {
+					s += params.get(key);
+				}
 			}
-			else {
-				s += params.get(key);
-			}
+			logger.debug(s);
 		}
-		logger.debug(s);
 		
 		return params;
 	}
Received on Monday, 2 August 2010 17:49:22 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:43 UTC