You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2009/04/30 10:14:50 UTC

svn commit: r770112 - /myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/logging.js

Author: lofwyr
Date: Thu Apr 30 08:14:50 2009
New Revision: 770112

URL: http://svn.apache.org/viewvc?rev=770112&view=rev
Log:
add severity to log output

Modified:
    myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/logging.js

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/logging.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/logging.js?rev=770112&r1=770111&r2=770112&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/logging.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/logging.js Thu Apr 30 08:14:50 2009
@@ -376,8 +376,17 @@
     if (typeof(message) == "string") {
       logMessage = document.createTextNode(message);
     } else if (typeof(message.type) == "number") {
-      // TODO severity marker
-      logMessage = document.createTextNode(message.message);
+      var prefix = "";
+      if (LOG.ERROR == message.type) {
+        prefix = prefix + "Error: ";
+      } else       if (LOG.WARN == message.type) {
+        prefix = prefix + "Warn:  ";
+      } else       if (LOG.INFO == message.type) {
+        prefix = prefix + "Info:  ";
+      } else       if (LOG.DEBUG == message.type) {
+        prefix = prefix + "Debug: ";
+      }
+      logMessage = document.createTextNode(prefix + message.message);
     }
     listElement.appendChild(logMessage);
     this.logList.appendChild(listElement);