rbrindley: branch rbrindley/astman_revamp r4548 - /team/rbrindley/astman_reva...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Mon Mar 2 19:16:15 CST 2009


Author: rbrindley
Date: Mon Mar  2 19:16:12 2009
New Revision: 4548

URL: http://svn.digium.com/svn-view/asterisk-gui?view=rev&rev=4548
Log:

- implemented log.colors to store all the colors for log messages (as opposed to hardcoding theme)
- implemented log.* - log.doLog, which has already been implemented


Modified:
    team/rbrindley/astman_revamp/config/js/log.js

Modified: team/rbrindley/astman_revamp/config/js/log.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/astman_revamp/config/js/log.js?view=diff&rev=4548&r1=4547&r2=4548
==============================================================================
--- team/rbrindley/astman_revamp/config/js/log.js (original)
+++ team/rbrindley/astman_revamp/config/js/log.js Mon Mar  2 19:16:12 2009
@@ -25,22 +25,48 @@
  * Main Log Object.
  * This log object contains all the needed logging functions for the GUI.
  */
-var log = {};
+var log = {
+	colors: {
+		ajax: '#96997c',
+		debug: '#4c9996',
+		error: '#992b23',
+		info: '#9a9a9a',
+		warn: '#f47a00'
+	}
+};
 
 /**
  * Log as ajax.
+ * @param msg The message.
  */
-log.ajax = function () {};
+log.ajax = function (msg) {
+	if (!msg || top.session.debug_which.ajax !== true) {
+		return true;
+	}
+	this.doLog(msg, this.colors.ajax);
+};
 
 /**
  * Log to the Console.
+ * @param msg The message.
  */
-log.console = function () {};
+log.console = function (msg) {
+	if (!msg || top.session.debug_which.console !== true || window.console || window.console.firebug) {
+		return true;
+	}
+	console.log(msg);
+};
 
 /**
  * Debug log.
+ * @param msg The message.
  */
-log.debug = function () {};
+log.debug = function (msg) {
+	if (!msg || top.session.debug_which.debug !== true) {
+		return true;
+	}
+	this.doLog(msg, this.colors.debug);
+};
 
 /**
  * Core Log Function.
@@ -68,15 +94,33 @@
 
 /**
  * Log as Error.
+ * @param msg The message.
  */
-log.error = function () {};
+log.error = function (msg) {
+	if (!msg || top.session.debug_which.error !== true) {
+		return true;
+	}
+	this.doLog(msg, this.colors.error);
+};
 
 /**
  * Log as Info.
+ * @param msg The message.
  */
-log.info = function () {};
+log.info = function (msg) {
+	if (!msg || top.session.debug_which.info !== true) {
+		return true;
+	}
+	this.doLog(msg, this.colors.info);
+};
 
 /**
  * Log as Warning.
+ * @param msg The message.
  */
-log.warn = function () {};
+log.warn = function (msg) {
+	if (!msg || top.session.debug_which.warn !== true) {
+		return true;
+	}
+	this.doLog(msg, this.colors.warn);
+};




More information about the asterisk-gui-commits mailing list