17 lines
734 B
JavaScript
17 lines
734 B
JavaScript
// Debug
|
|
const debug = require('debug');
|
|
|
|
/**
|
|
* Create the different logging methods for a function
|
|
* Namespace template = ("[app]:[fileName]:['INFO', 'WARNING', 'DEBUG', 'ERROR']")
|
|
* @param {string} appName The name of the app to be used in the 'app' portion of the namespace
|
|
* @param {string} fileName The name of the file calling the builder to be used in the 'fileName' portion of the namespace
|
|
*/
|
|
exports.DebugBuilder = class DebugBuilder {
|
|
constructor(appName, fileName) {
|
|
this.INFO = debug(`${appName}:${fileName}:INFO`);
|
|
this.DEBUG = debug(`${appName}:${fileName}:DEBUG`);
|
|
this.WARN = debug(`${appName}:${fileName}:WARNING`);
|
|
this.ERROR = debug(`${appName}:${fileName}:ERROR`);
|
|
}
|
|
} |