How to use the debug.log function in debug

To help you get started, we’ve selected a few debug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tlqylzn / export-to-excel / src / excel / xlsx.js View on Github external
// 头部数据
            titleKeys.forEach(function(t) {
                rowObj[t] = obj[t];
            });
            formatData.push(rowObj);
        });

        // 取表格title
        opts.title.forEach(function(obj) {
            title[obj.fieldName] = obj.displayName;
        });

        formatData.unshift(title);
        
    } else {
        debug.log('title必须为array');

        return 'title必须为array';
    }

    if (!opts.filename) {
        debug.log('filename不能为空');

        return 'filename不能为空';
    }
    if (!opts.sheetname) {
        debug.log('sheetname不能为空');

        return 'sheetname不能为空';
    }

    if (formatData.length === 1) {
github tlqylzn / export-to-excel / src / excel / xlsx.js View on Github external
// 取表格title
        opts.title.forEach(function(obj) {
            title[obj.fieldName] = obj.displayName;
        });

        formatData.unshift(title);
        
    } else {
        debug.log('title必须为array');

        return 'title必须为array';
    }

    if (!opts.filename) {
        debug.log('filename不能为空');

        return 'filename不能为空';
    }
    if (!opts.sheetname) {
        debug.log('sheetname不能为空');

        return 'sheetname不能为空';
    }

    if (formatData.length === 1) {
        debug.log('没有' + opts.sheetname + '数据');

        return '没有' + opts.sheetname + '数据';
    }
github ClementNerma / NightOS-v2 / apps / dolphin / dolphin.js View on Github external
/** The system module
  * @type {object} */
const system = runtime.level >= fs.ROOT_LEVEL ? require('system') : null;

/** The web page's document
  * @type {Document} */
const document = system ? system.window.document : null;

/** The translation function
  * @type {function} */
const tr = translate.translate;

// If the application was loaded as a launcher...
if(runtime.arguments.launcher) {
  debug.log('Running dolphin launcher...');

  // Run the launcher's file in the global's context
  system.loadScript(runtime.path + '/launcher.js', () => {
    debug.error(tr('Failed to load the launcher file'));
  });
} else {
  /** The translation package path
    * @type {string} */
  // NOTE: We load the translation only here because the launcher will have
  //       to load it by itself (translations are not synchronous between
  //       main and child processes)
  let tr_path = fs.makeAbsolute('translations/' + translate.language + '.ntp');

  // If the translation was not loaded and a package exists for this language...
  if(!translate.loaded(tr_path) && fs.fileExists(tr_path) === true) {
    // Load the translation package
github microsoft / fluent-ui-react / build / gulp / tasks / test-vulns.ts View on Github external
const log = message => debug.log(message)
log.success = message => debug.log(`✔ ${message}`)
github NetEase / lordofpomelo / web-server / public / js / lib / colorbox / node.js View on Github external
removeChild: function(child)
  {
    var idx = -1;
    this._children.some(function(node, index, arr)
                        {
                          if (idx == -1 && node == child)
                          {
                            idx = index;
                            return true;
                          }
                          else
                            return false;
                        });
    if (idx == -1 || idx == this._children.length)
    {
      debug.log("this cannot remove the child, the child'a parent is not parent");
      return;
    }
    
    this.onExit();
    
    child._parent = null;
    this._children.splice(idx, 1);
    
    child.exec("setMatrixDep", null);
  },
github tlqylzn / export-to-excel / src / excel / xlsx.js View on Github external
return 'title必须为array';
    }

    if (!opts.filename) {
        debug.log('filename不能为空');

        return 'filename不能为空';
    }
    if (!opts.sheetname) {
        debug.log('sheetname不能为空');

        return 'sheetname不能为空';
    }

    if (formatData.length === 1) {
        debug.log('没有' + opts.sheetname + '数据');

        return '没有' + opts.sheetname + '数据';
    }


    workbook.Sheets[opts.sheetname] = fromJSONArray(formatData, opts.title);

    XLSX.writeFile(workbook, opts.filename + '.xlsx');

    return opts.filename + '.xlsx';
}
github Xantier / nerd-stack / gulpfile.js View on Github external
.on('restart', function () {
        debug.log('restarted!');
      });
});
github tlqylzn / export-to-excel / src / excel / xlsx.js View on Github external
formatData.unshift(title);
        
    } else {
        debug.log('title必须为array');

        return 'title必须为array';
    }

    if (!opts.filename) {
        debug.log('filename不能为空');

        return 'filename不能为空';
    }
    if (!opts.sheetname) {
        debug.log('sheetname不能为空');

        return 'sheetname不能为空';
    }

    if (formatData.length === 1) {
        debug.log('没有' + opts.sheetname + '数据');

        return '没有' + opts.sheetname + '数据';
    }


    workbook.Sheets[opts.sheetname] = fromJSONArray(formatData, opts.title);

    XLSX.writeFile(workbook, opts.filename + '.xlsx');

    return opts.filename + '.xlsx';