Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AFBE99AA9 for ; Mon, 26 Mar 2012 00:25:02 +0000 (UTC) Received: (qmail 38131 invoked by uid 500); 26 Mar 2012 00:25:02 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 38090 invoked by uid 500); 26 Mar 2012 00:25:02 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 38083 invoked by uid 99); 26 Mar 2012 00:25:02 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2012 00:25:02 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C286D8E85; Mon, 26 Mar 2012 00:25:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: filmaj@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: [CB-364] added utils.log method which will console.log if available or, if not, alert a message Message-Id: <20120326002501.C286D8E85@tyr.zones.apache.org> Date: Mon, 26 Mar 2012 00:25:01 +0000 (UTC) Updated Branches: refs/heads/master 2fe9fcabf -> 396b9faf3 [CB-364] added utils.log method which will console.log if available or, if not, alert a message Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/396b9faf Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/396b9faf Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/396b9faf Branch: refs/heads/master Commit: 396b9faf3fe0319e5933129ec9f94fc1db5c49a0 Parents: 2fe9fca Author: Fil Maj Authored: Sun Mar 25 17:25:27 2012 -0700 Committer: Fil Maj Committed: Sun Mar 25 17:25:27 2012 -0700 ---------------------------------------------------------------------- lib/common/utils.js | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/396b9faf/lib/common/utils.js ---------------------------------------------------------------------- diff --git a/lib/common/utils.js b/lib/common/utils.js index 49f6093..30a41d8 100644 --- a/lib/common/utils.js +++ b/lib/common/utils.js @@ -87,8 +87,18 @@ var _self = { Child.__super__ = Parent.prototype; Child.prototype.constructor = Child; }; - }()) + }()), + /** + * Logs a message in any available way: console.log or alert. + */ + log:function(msg) { + if (console && console.log) { + console.log(msg); + } else if (alert) { + alert(msg); + } + } }; module.exports = _self;