Consider adding a debug option #311

Closed
pascalduez opened this Issue Jan 7, 2015 · 11 comments

Comments

Projects
None yet
4 participants
@pascalduez
Member

pascalduez commented Jan 7, 2015

After seeing issues like #309 #310 and obviously other ones in the past, we could benefit from adding a new -d --debug options.
This would not produce the final documentation but output useful information on the current environment. Either to stdout or in a sassdoc-debug.log.

  • SassDoc version
  • Node.js version
  • npm version
  • platform
  • CLI location (either global or local)
  • If CLI command run and options
  • is a plugin used (Grunt, Gulp, ...)
  • source path
  • destination path
  • CWD (maybe not useful for plugins?)
  • environment (implies config)
  • data
@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Jan 7, 2015

Member

I like that.

Member

HugoGiraudel commented Jan 7, 2015

I like that.

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Jan 7, 2015

Member

👍

Added CWD in your list.

Member

valeriangalliat commented Jan 7, 2015

👍

Added CWD in your list.

@HugoGiraudel HugoGiraudel added the Feature label Jan 8, 2015

@HugoGiraudel HugoGiraudel modified the milestone: 2.0 Jan 8, 2015

@FWeinb FWeinb referenced this issue Jan 9, 2015

Closed

[Meta] Development SassDoc 2.0 #255

20 of 20 tasks complete

@valeriangalliat valeriangalliat self-assigned this Jan 9, 2015

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Jan 9, 2015

Member

is a plugin used (Grunt, Gulp, ...)

I don't understand. If --debug is a CLI option, plugins are not concerned, right?

Member

valeriangalliat commented Jan 9, 2015

is a plugin used (Grunt, Gulp, ...)

I don't understand. If --debug is a CLI option, plugins are not concerned, right?

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Jan 9, 2015

Member

I don't understand. If --debug is a CLI option, plugins are not concerned, right?

Good call... Would be interesting to be able to debug from plugins as well. Which means it should be a config option as well.

Member

pascalduez commented Jan 9, 2015

I don't understand. If --debug is a CLI option, plugins are not concerned, right?

Good call... Would be interesting to be able to debug from plugins as well. Which means it should be a config option as well.

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Jan 9, 2015

Member

That's what I had in mind. I'll log some CLI-specific stuff in cli.js and the rest in sassdoc.js, and debug will be a config option (but ideally this config option should be settable from Grunt/Gulp command, like grunt --sassdoc-debug or something, without having to modify the *file).

Member

valeriangalliat commented Jan 9, 2015

That's what I had in mind. I'll log some CLI-specific stuff in cli.js and the rest in sassdoc.js, and debug will be a config option (but ideally this config option should be settable from Grunt/Gulp command, like grunt --sassdoc-debug or something, without having to modify the *file).

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Jan 9, 2015

Member

grunt --sassdoc-debug that's not desirable.

What about env.debug = options['--debug'] in CLI ?

Also logging might be handy, but printing to a file would be a better option especially if we print the environment and/or data.

What I had in mind was to maybe use a stream (again).

Member

pascalduez commented Jan 9, 2015

grunt --sassdoc-debug that's not desirable.

What about env.debug = options['--debug'] in CLI ?

Also logging might be handy, but printing to a file would be a better option especially if we print the environment and/or data.

What I had in mind was to maybe use a stream (again).

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Jan 9, 2015

Member

No problem in CLI, I have already some helper to proxy command line arguments to configuration options.

About plugins, the only use case I see is:

  • Run grunt;
  • It fails;
  • Run grunt --sassdoc-debug (or SASSDOC_DEBUG=1 grunt or whatever you can pass on CLI);
  • Paste output in issue.

I don't think it's desirable to have to edit a file to enable debug mode (which is nearly always a temporary option), even for plugins.

Member

valeriangalliat commented Jan 9, 2015

No problem in CLI, I have already some helper to proxy command line arguments to configuration options.

About plugins, the only use case I see is:

  • Run grunt;
  • It fails;
  • Run grunt --sassdoc-debug (or SASSDOC_DEBUG=1 grunt or whatever you can pass on CLI);
  • Paste output in issue.

I don't think it's desirable to have to edit a file to enable debug mode (which is nearly always a temporary option), even for plugins.

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Jan 9, 2015

Member

I don't think it's desirable to have to edit a file to enable debug mode (which is nearly always a temporary option), even for plugins.

You won, good argumentation :-)

With Grunt it's fairly easy to pass arguments, not sure about the others. Especially because there's no more Gulp plugins anymore \o/.

Member

pascalduez commented Jan 9, 2015

I don't think it's desirable to have to edit a file to enable debug mode (which is nearly always a temporary option), even for plugins.

You won, good argumentation :-)

With Grunt it's fairly easy to pass arguments, not sure about the others. Especially because there's no more Gulp plugins anymore \o/.

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Jan 9, 2015

Member

Well for sure SASSDOC_DEBUG=1 grunt|gulp|any will work, since we can always access environment variables. 😄

So I'm not even setting this as a configuration option; I just take it from environment or CLI option. This implies there's literally nothing to update in the plugins, and I like it.

Member

valeriangalliat commented Jan 9, 2015

Well for sure SASSDOC_DEBUG=1 grunt|gulp|any will work, since we can always access environment variables. 😄

So I'm not even setting this as a configuration option; I just take it from environment or CLI option. This implies there's literally nothing to update in the plugins, and I like it.

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Jan 9, 2015

Member

👍

Member

pascalduez commented Jan 9, 2015

👍

valeriangalliat added a commit to SassDoc/sassdoc.github.io that referenced this issue Jan 9, 2015

@valeriangalliat valeriangalliat referenced this issue in SassDoc/sassdoc.github.io Jan 9, 2015

Merged

Add a debug option #83

valeriangalliat added a commit that referenced this issue Jan 9, 2015

@FWeinb

This comment has been minimized.

Show comment
Hide comment
@FWeinb

FWeinb Jan 9, 2015

Member

👍

Member

FWeinb commented Jan 9, 2015

👍

valeriangalliat added a commit to SassDoc/sassdoc.github.io that referenced this issue Jan 9, 2015

valeriangalliat added a commit to SassDoc/sassdoc.github.io that referenced this issue Jan 9, 2015

valeriangalliat added a commit that referenced this issue Jan 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment