Closed dbachrach closed 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.
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
Closing due to inactivity
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
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.