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

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: More 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..9ab9a1240ba2e64e990003ed7c7fd1d98d2c05d1
--- /dev/null
+++ b/chrome/browser/resources/hotword/logging.js
@@ -0,0 +1,21 @@
+// 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';
+
+ /**
+ * 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: false,
+ 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