Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-9821

Fix EventEmitter incorrect trace level usages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • cordova-lib

    Description

      I see some places where we use incorrect log level argument, like 'err' or 'debug' so those traces are ignored and not displayed or could be intercepted by CordovaCLI/Plugman or other tools.

      For example (we don't support 'debug'; the correct argument here is 'verbose'):

      function getPluginsHookScripts(hook, opts) {
          // args check
          if (!hook) {
              throw new Error('hook type is not specified');
          }
      
          // In case before_plugin_install, after_plugin_install, before_plugin_uninstall hooks we receive opts.plugin and
          // retrieve scripts exclusive for this plugin.
          if(opts.plugin) {
              events.emit('debug', 'Executing "' + hook + '"  hook for "' + opts.plugin.id + '" on ' + opts.plugin.platform + '.');
              // if plugin hook is not run for specific platform then use all available platforms
              return getPluginScriptFiles(opts.plugin, hook, opts.plugin.platform  ? [opts.plugin.platform] : opts.cordova.platforms);
          }
      
          events.emit('debug', 'Executing "' + hook + '"  hook for all plugins.');
          return getAllPluginsHookScriptFiles(hook, opts);
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            sgrebnov Sergey Grebnov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: