[richfaces-svn-commits] JBoss Rich Faces SVN: r18955 - in trunk: ui/core/ui/src/main/resources/META-INF/resources/org.richfaces and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Aug 24 13:49:58 EDT 2010


Author: nbelaevski
Date: 2010-08-24 13:49:57 -0400 (Tue, 24 Aug 2010)
New Revision: 18955

Modified:
   trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
   trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js
Log:
https://jira.jboss.org/browse/RF-9131

Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js	2010-08-24 17:23:32 UTC (rev 18954)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js	2010-08-24 17:49:57 UTC (rev 18955)
@@ -143,27 +143,54 @@
 		return s.replace(CSS_METACHARS_PATTERN, "\\$1");
 	};
 
+	var logImpl;
+	
+	richfaces.setLog = function(newLogImpl) {
+		logImpl = newLogImpl;
+	};
+	
 	richfaces.log = {
 		debug: function(text) {
+			if (logImpl) {
+				logImpl.debug(text);
+			}
 		},
 
 		info: function(text) {
+			if (logImpl) {
+				logImpl.info(text);
+			}
 		},
 
 		warn: function(text) {
+			if (logImpl) {
+				logImpl.warn(text);
+			}
 		},
 
 		error: function(text) {
+			if (logImpl) {
+				logImpl.error(text);
+			}
 		},
 		
 		setLevel: function(level) {
+			if (logImpl) {
+				logImpl.setLevel(level);
+			}
 		},
 
 		getLevel: function() {
+			if (logImpl) {
+				return logImpl.getLevel();
+			}
 			return 'info';
 		},
 		
 		clear: function() {
+			if (logImpl) {
+				logImpl.clear();
+			}
 		}
 	};
 

Modified: trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js
===================================================================
--- trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js	2010-08-24 17:23:32 UTC (rev 18954)
+++ trunk/ui/core/ui/src/main/resources/META-INF/resources/org.richfaces/log.js	2010-08-24 17:49:57 UTC (rev 18955)
@@ -171,8 +171,7 @@
 		init: function(options) {
 			this.$super.constructor.call(this, 'richfaces.log');
 			this.attachToDom();
-			this.__initialLogImpl = richfaces.log;
-			richfaces.log = this;
+			richfaces.setLog(this);
 			
 			this.level = options.level;
 			this.hotkey = options.hotkey;
@@ -187,8 +186,7 @@
 		},
 
 		destroy: function() {
-			richfaces.log = this.__initialLogImpl;
-			this.__initialLogImpl = null;
+			richfaces.setLog(null);
 			
 			//TODO test this method
 			if (this.__popupWindow) {



More information about the richfaces-svn-commits mailing list