alanshaw / stripify

Browserify transform that strips console.log lines from your code
https://www.npmjs.org/package/stripify
MIT License
35 stars 11 forks source link

Allow some console statements to be preserved #6

Closed dbachrach closed 8 years ago

dbachrach commented 8 years ago

This PR allows specific console statements to be preserved. We wanted this so we could use console.logs liberally through our codebase and have them stripped, but still allow very specific messages to be included for production.

In this PR, we look for console messages that begin with '!Stripify:Preserve!' to indicate which log messages should be preserved.

waylonflinn commented 8 years ago

I have similar needs. My thoughts on a solution were to specify a log level and use console.warn, console.error, etc.

alanshaw commented 8 years ago

I appreciate the work done here but I think I prefer to use a comment to specify this, much like the linting tools do to disable linting on a specific line: http://eslint.org/docs/user-guide/configuring#disabling-rules-with-inline-comments

alanshaw commented 8 years ago

Closing due to inactivity

1le commented 8 years ago

Bummer, was just going to propose extending the logic to allow what @waylonflinn suggested. :) Anyhows, i created a pull request: https://github.com/alanshaw/stripify/pull/12