less.js icon indicating copy to clipboard operation
less.js copied to clipboard

option to disable/control log messages

Open mariusa opened this issue 14 years ago • 14 comments

Hello,

Using less, one gets these messages in console on every page load: less: parsed a.less successfully. less: saving a.less to cache. less: css for a.less generated in 82ms less: css generated in 83ms

Please generate these only if specifically asked by users, even on development. I saw it's possible to do

For some, these messages are just noise.

Thanks

mariusa avatar Mar 18 '12 09:03 mariusa

+1

drinchev avatar Mar 30 '12 14:03 drinchev

+1

FPurchess avatar Sep 18 '12 13:09 FPurchess

+1

tjwebb avatar May 18 '13 17:05 tjwebb

Yeah that's a must. If we are debugging our javascript, LESS shouldn't spam the console. Maybe only when parsing fails. Temporary dirty fix for now:

<script>
    var console_backup = console
    console = { log = function(){} }
</script>
<script src="less.js"></script>
<script>
    console = console_backup
</script>

Desired fix proposal:

<script>
    less = {
        log_level: 0
    }
</script>

Where: 0 = off 1 = only errors 2 = all output

gitaarik avatar Jun 28 '13 16:06 gitaarik

Would you like to do a pull request?

lukeapage avatar Jul 04 '13 20:07 lukeapage

I just started looking at the less.js source today. I would like to get involved but it might take me some time. Any recommendations to get started?

gitaarik avatar Jul 05 '13 10:07 gitaarik

Any specific questions? If so will do my best. Would be good to work on the 1.5.0-wip branch.

lukeapage avatar Jul 05 '13 17:07 lukeapage

I've created a pull request for this: https://github.com/less/less.js/pull/1442

gitaarik avatar Jul 24 '13 09:07 gitaarik

pulled

lukeapage avatar Aug 22 '13 18:08 lukeapage

Has a fix for this been created yet?

Jameron avatar Mar 26 '14 19:03 Jameron

@KillaCam see changelog

seven-phases-max avatar Mar 26 '14 20:03 seven-phases-max

Thanks for this feature, only I really struggled to find documentation for this setting, then scanned the less JS file and finally found the logLevel function after a while. So for anyone looking at how to set this, within the var less options:

var less = { logLevel: 0 // No errors at all (1 displays errors only, 2 displays info (default)) };

rm-bergmann avatar Apr 15 '14 09:04 rm-bergmann

... I really struggled to find documentation for this setting

lesscss.org -> Usage -> Using Less in the Browser -> Client side options -> logLevel

seven-phases-max avatar Apr 15 '14 09:04 seven-phases-max

And there it is! Thanks. Was still difficult to find on the site, probably because I didn't know what to look for.

rm-bergmann avatar Apr 15 '14 09:04 rm-bergmann