Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify use of DEBUG in standalone version #153

Closed
necolas opened this issue Jul 28, 2013 · 8 comments
Closed

Clarify use of DEBUG in standalone version #153

necolas opened this issue Jul 28, 2013 · 8 comments

Comments

@necolas
Copy link
Contributor

necolas commented Jul 28, 2013

Doesn't seem like you can use DEBUG in the standalone version, but it's still bundled.

@creativej
Copy link

Would love to see DEBUG working in the standalone version. It would help me so much.

@fehmicansaglam
Copy link

+1

@fhpriamo
Copy link

I came across this issue too. The lack of documentation on the standalone version specifics is a frustrating issue as well.

@margaritis
Copy link
Contributor

+1

@6twenty
Copy link
Contributor

6twenty commented May 8, 2014

Looks like the debug module has been left out of the standalone version during the build process. You can fix this and do a manual build (provided you have Node) in order to activate debugging with the standalone version:

  1. Clone the git repo, and cd into the directory
  2. Run npm install and bower install
  3. Open lib/index.js and add the debug module (see example file below)
  4. Run mkdir build
  5. Run node tools/standalone/build.js (compiled flight.js and flight.min.js will appear in the build directory)
  6. Prior to loading your Flight component(s), add:
flight.debug.enable(true);
DEBUG.events.logAll();

Lastly: when building your Flight component(s), pass flight.logger as a mixin to activate debug logging:

var myWidget = flight.component(init, flight.logger);
function init () { ... }
// lib/index.js
define(

  [
    './advice',
    './component',
    './compose',
    './debug',
    './logger',
    './registry',
    './utils'
  ],

  function(advice, component, compose, debug, logger, registry, utils) {
    'use strict';

    return {
      advice: advice,
      component: component,
      compose: compose,
      debug: debug,
      logger: logger,
      registry: registry,
      utils: utils
    };

  }
);

I've sent a pull request (#258) to try to get this incorporated into Flight master.

@6twenty
Copy link
Contributor

6twenty commented May 9, 2014

Correction; I wasn't using the correct form to enable debug logging. The correct method is like so:

flight.debug.enable(true); // Must pass true (or false)
DEBUG.events.logAll();

@necolas
Copy link
Contributor Author

necolas commented Aug 1, 2014

This will be fixed when #294 is merged.

@necolas necolas closed this as completed Aug 1, 2014
@necolas
Copy link
Contributor Author

necolas commented Aug 5, 2014

Applied in e66b0ec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants