diff options
author | Minteck <contact@minteck.org> | 2022-06-04 08:51:19 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-06-04 08:51:19 +0200 |
commit | b22f6770c8bd084d66950655203c61dd701b3d90 (patch) | |
tree | 873d7fb19584ec2709b95cc1ca05a1fc7cfd0fc4 /node_modules/nodemon/lib/utils/log.js | |
parent | 383285ecd5292bf9a825e05904955b937de84cc9 (diff) | |
download | equestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.tar.gz equestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.tar.bz2 equestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.zip |
Remove node_modules
Diffstat (limited to 'node_modules/nodemon/lib/utils/log.js')
-rw-r--r-- | node_modules/nodemon/lib/utils/log.js | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/node_modules/nodemon/lib/utils/log.js b/node_modules/nodemon/lib/utils/log.js deleted file mode 100644 index 6580087..0000000 --- a/node_modules/nodemon/lib/utils/log.js +++ /dev/null @@ -1,82 +0,0 @@ -var colour = require('./colour'); -var bus = require('./bus'); -var required = false; -var useColours = true; - -var coding = { - log: 'black', - info: 'yellow', - status: 'green', - detail: 'yellow', - fail: 'red', - error: 'red', -}; - -function log(type, text) { - var msg = '[nodemon] ' + (text || ''); - - if (useColours) { - msg = colour(coding[type], msg); - } - - // always push the message through our bus, using nextTick - // to help testing and get _out of_ promises. - process.nextTick(() => { - bus.emit('log', { type: type, message: text, colour: msg }); - }); - - // but if we're running on the command line, also echo out - // question: should we actually just consume our own events? - if (!required) { - if (type === 'error') { - console.error(msg); - } else { - console.log(msg || ''); - } - } -} - -var Logger = function (r) { - if (!(this instanceof Logger)) { - return new Logger(r); - } - this.required(r); - return this; -}; - -Object.keys(coding).forEach(function (type) { - Logger.prototype[type] = log.bind(null, type); -}); - -// detail is for messages that are turned on during debug -Logger.prototype.detail = function (msg) { - if (this.debug) { - log('detail', msg); - } -}; - -Logger.prototype.required = function (val) { - required = val; -}; - -Logger.prototype.debug = false; -Logger.prototype._log = function (type, msg) { - if (required) { - bus.emit('log', { type: type, message: msg || '', colour: msg || '' }); - } else if (type === 'error') { - console.error(msg); - } else { - console.log(msg || ''); - } -}; - -Object.defineProperty(Logger.prototype, 'useColours', { - set: function (val) { - useColours = val; - }, - get: function () { - return useColours; - }, -}); - -module.exports = Logger; |