browser/components/customizableui/src/logging.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/customizableui/src/logging.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +#if 0
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +#endif
     1.9 +
    1.10 +XPCOMUtils.defineLazyModuleGetter(this, "console",
    1.11 +  "resource://gre/modules/devtools/Console.jsm");
    1.12 +
    1.13 +let gDebug = false;
    1.14 +try {
    1.15 +  gDebug = Services.prefs.getBoolPref(kPrefCustomizationDebug);
    1.16 +} catch (e) {}
    1.17 +
    1.18 +function LOG(...args) {
    1.19 +  if (gDebug) {
    1.20 +    args.unshift(gModuleName);
    1.21 +    console.log.apply(console, args);
    1.22 +  }
    1.23 +}
    1.24 +
    1.25 +function ERROR(...args) {
    1.26 +  args.unshift(gModuleName);
    1.27 +  console.error.apply(console, args);
    1.28 +}
    1.29 +
    1.30 +function INFO(...args) {
    1.31 +  args.unshift(gModuleName);
    1.32 +  console.info.apply(console, args);
    1.33 +}
    1.34 +

mercurial