stuff
This commit is contained in:
35
buildfiles/app/node_modules/@dabh/diagnostics/browser/development.js
generated
vendored
Normal file
35
buildfiles/app/node_modules/@dabh/diagnostics/browser/development.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
var create = require('../diagnostics');
|
||||
|
||||
/**
|
||||
* Create a new diagnostics logger.
|
||||
*
|
||||
* @param {String} namespace The namespace it should enable.
|
||||
* @param {Object} options Additional options.
|
||||
* @returns {Function} The logger.
|
||||
* @public
|
||||
*/
|
||||
var diagnostics = create(function dev(namespace, options) {
|
||||
options = options || {};
|
||||
options.namespace = namespace;
|
||||
options.prod = false;
|
||||
options.dev = true;
|
||||
|
||||
if (!dev.enabled(namespace) && !(options.force || dev.force)) {
|
||||
return dev.nope(options);
|
||||
}
|
||||
|
||||
return dev.yep(options);
|
||||
});
|
||||
|
||||
//
|
||||
// Configure the logger for the given environment.
|
||||
//
|
||||
diagnostics.modify(require('../modifiers/namespace'));
|
||||
diagnostics.use(require('../adapters/localstorage'));
|
||||
diagnostics.use(require('../adapters/hash'));
|
||||
diagnostics.set(require('../logger/console'));
|
||||
|
||||
//
|
||||
// Expose the diagnostics logger.
|
||||
//
|
||||
module.exports = diagnostics;
|
8
buildfiles/app/node_modules/@dabh/diagnostics/browser/index.js
generated
vendored
Normal file
8
buildfiles/app/node_modules/@dabh/diagnostics/browser/index.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
//
|
||||
// Select the correct build version depending on the environment.
|
||||
//
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./production.js');
|
||||
} else {
|
||||
module.exports = require('./development.js');
|
||||
}
|
6
buildfiles/app/node_modules/@dabh/diagnostics/browser/override.js
generated
vendored
Normal file
6
buildfiles/app/node_modules/@dabh/diagnostics/browser/override.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
var diagnostics = require('./');
|
||||
|
||||
//
|
||||
// No way to override `debug` with `diagnostics` in the browser.
|
||||
//
|
||||
module.exports = diagnostics;
|
24
buildfiles/app/node_modules/@dabh/diagnostics/browser/production.js
generated
vendored
Normal file
24
buildfiles/app/node_modules/@dabh/diagnostics/browser/production.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
var create = require('../diagnostics');
|
||||
|
||||
/**
|
||||
* Create a new diagnostics logger.
|
||||
*
|
||||
* @param {String} namespace The namespace it should enable.
|
||||
* @param {Object} options Additional options.
|
||||
* @returns {Function} The logger.
|
||||
* @public
|
||||
*/
|
||||
var diagnostics = create(function prod(namespace, options) {
|
||||
options = options || {};
|
||||
options.namespace = namespace;
|
||||
options.prod = true;
|
||||
options.dev = false;
|
||||
|
||||
if (!(options.force || prod.force)) return prod.nope(options);
|
||||
return prod.yep(options);
|
||||
});
|
||||
|
||||
//
|
||||
// Expose the diagnostics logger.
|
||||
//
|
||||
module.exports = diagnostics;
|
Reference in New Issue
Block a user