"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/debuglog/debuglog.js" (8 Mar 2017, 554 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 var util = require('util');
    2 
    3 module.exports = (util && util.debuglog) || debuglog;
    4 
    5 var debugs = {};
    6 var debugEnviron = process.env.NODE_DEBUG || '';
    7 
    8 function debuglog(set) {
    9   set = set.toUpperCase();
   10   if (!debugs[set]) {
   11     if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
   12       var pid = process.pid;
   13       debugs[set] = function() {
   14         var msg = util.format.apply(exports, arguments);
   15         console.error('%s %d: %s', set, pid, msg);
   16       };
   17     } else {
   18       debugs[set] = function() {};
   19     }
   20   }
   21   return debugs[set];
   22 };