Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/candy-chat/candy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Klang <bklang@mojolingo.com>2015-03-23 18:25:53 +0300
committerBen Klang <bklang@mojolingo.com>2015-03-24 17:39:15 +0300
commitf54ae33298133d4f84d64dc7c1f58700a760d08d (patch)
tree6bcdb6e470aabc08d8562761e66ef715a685c318
parent6869080bd7978385dc4604ca479b390917ca83f1 (diff)
Add warn and error logging levels
-rw-r--r--src/core.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core.js b/src/core.js
index ad56181..5fb5683 100644
--- a/src/core.js
+++ b/src/core.js
@@ -508,5 +508,21 @@ Candy.Core = (function(self, Strophe, $) {
*/
self.log = function() {};
+ /** Function: warn
+ * Print a message to the browser's "info" log
+ * Enabled regardless of debug mode
+ */
+ self.warn = function() {
+ Function.prototype.apply.call(console.warn, console, arguments);
+ }
+
+ /** Function: error
+ * Print a message to the browser's "error" log
+ * Enabled regardless of debug mode
+ */
+ self.warn = function() {
+ Function.prototype.apply.call(console.error, console, arguments);
+ }
+
return self;
}(Candy.Core || {}, Strophe, jQuery));