REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.70 KB
Close
/home/byroehnu/.trash/node_modules11/nodemon/lib/utils/log.js
Text
Base64
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;
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
bus.js
946 B
lrw-r--r--
2026-02-03 15:06:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
clone.js
829 B
lrw-r--r--
2026-02-03 15:06:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
colour.js
690 B
lrw-r--r--
2026-02-03 15:06:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
2.56 KB
lrw-r--r--
2026-02-03 15:06:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
log.js
1.70 KB
lrw-r--r--
2026-02-03 15:06:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
merge.js
1.16 KB
lrw-r--r--
2026-02-03 15:06:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).