Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: chrome/browser/resources/hotword/logging.js

Issue 601123002: Add a trivial logging wrapper around console.log, and add some useful log (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/hotword/logging.js
diff --git a/chrome/browser/resources/hotword/logging.js b/chrome/browser/resources/hotword/logging.js
new file mode 100644
index 0000000000000000000000000000000000000000..4f69b46c518b8d09927b1258aa33f5a9e1297ed2
--- /dev/null
+++ b/chrome/browser/resources/hotword/logging.js
@@ -0,0 +1,23 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('hotword', function() {
+ 'use strict';
+
+ var DEBUG = false;
Dan Beam 2014/09/30 03:42:58 nit: just remove this
Anand Mistry (off Chromium) 2014/09/30 04:14:03 Done.
+
+ /**
+ * Wrapper around console.log allowing debug log message to be enabled during
+ * development.
+ */
+ function debug() {
+ if (hotword.DEBUG || window.localStorage['hotword.DEBUG'])
+ console.log.apply(console, arguments);
+ }
+
+ return {
+ DEBUG: DEBUG,
Dan Beam 2014/09/30 03:42:58 DEBUG: false,
Anand Mistry (off Chromium) 2014/09/30 04:14:03 Done.
+ debug: debug
+ };
+});
« no previous file with comments | « chrome/browser/resources/component_extension_resources.grd ('k') | chrome/browser/resources/hotword/manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698