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

excess logging clutters console #669

Open
sunilw opened this issue Mar 5, 2015 · 2 comments
Open

excess logging clutters console #669

sunilw opened this issue Mar 5, 2015 · 2 comments

Comments

@sunilw
Copy link

sunilw commented Mar 5, 2015

First off: this plugin is fantastic. Thanks for developing it. It's my first choice of component for doing things like building wordpress slider plugins.

Using the minified messages are logged to console. I see output like this:

[cycle2] --c2 init--jquery.cycle2.min.js:6 [cycle2] speed: 400 (number)
jquery.cycle2.min.js:6 [cycle2] activeClass: active (string)
jquery.cycle2.min.js:6 [cycle2] random: true (boolean)
jquery.cycle2.min.js:6 [cycle2] slides: div (string)`

I can see how this is useful, but does this kind of logging need to be in the minified version?

My usual expectation is that logging messages are stripped out of minified scripts, because the minified version are more likely to be used in production. At that point, logging is unneccesary.

I'm finding that if I use the minified version and I'm debugging something else on the page, logging from the minified cycle2 clutters the console, making it a little more difficult to find my own logging messages.

Thanks.

@malsup
Copy link
Owner

malsup commented Mar 5, 2015

The minified version is just that, a minified version. It doesn't make any
changes to the options or strip any lines that do logging.

Your options:

  1. disable logging in your production html using data-cycle-log=false.
  2. disable logging in your production javascript by appending this after
    the cycle script: $.fn.cycle.log = $.noop;
  3. wait for me to flip the default value of the log option (could be a
    while, sorry)

On Wed, Mar 4, 2015 at 8:51 PM, sunil notifications@github.com wrote:

First off: this plugin is fantastic. Thanks for developing it. It's my
first choice of component for doing things like building wordpress slider
plugins.

Using the minified messages are logged to console. I see output like this:

`[cycle2] --c2 init--

jquery.cycle2.min.js:6 [cycle2] speed: 400 (number)
jquery.cycle2.min.js:6 [cycle2] activeClass: active (string)
jquery.cycle2.min.js:6 [cycle2] random: true (boolean)
jquery.cycle2.min.js:6 [cycle2] slides: div (string)`

I can see how this is useful, but does this kind of logging need to be in
the minified version?

My usual expectation is that logging messages are stripped out of minified
scripts, because the minified version are more likely to be used in
production. At that point, logging is unneccesary.

I'm finding that if I use the minified version and I'm debugging something
else on the page, logging from the minified cycle2 clutters the console,
making it a little more difficult to find my own logging messages.

Thanks.


Reply to this email directly or view it on GitHub
#669.

@sunilw
Copy link
Author

sunilw commented Mar 6, 2015

Thanks for the quick response Mike.

For the moment I'm sure that setting data-cycle to false will be fine.

I'm not sure whether to close the issue or not. That would depend on what the design intent is for the minified version. So I guess I'll leave the decision whether to close the issue or not to you.

Again, thanks for cycle2. It's great.

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

2 participants