dont-care-log
v0.0.8
Published
teach git stage/diff how to ignore specific logging code
Readme
dont-care-log
Teach git stage/diff how to ignore specific logging code,
so your logging code will never be commit automatically,
of course also wont show dirty in git.
Example
Assuming that a new file in you project like:
import path from 'path'
const getFile = () => {
const name = 'foo'
const file = path.join(__dirname, name)
console.log('TCL: getFile() -> name:', file)
return file
}and with installed dont-care-log, you will only see this output below on git status/add/diff commands
+ import path from 'path'
+
+ const getFile = () => {
+ const name = 'foo'
+ const file = path.join(__dirname, name)
+ return file
+ }Amazing, there is no line of console.log('TCL: ...)
Install
npm i -D dont-care-logand Turbo Console Log for VSCode
How it works
dont-care-log only teach git to ignore the specific format line which is prefixed with any spaces and console.log('TCL: (default format of Turbo Console Log).
Well, here defined a filter.clean pipe to drop the specific line (generated by Turbo-Console-Log),
and some preinstall hook to setup .gitconfig and .gitattributes.
More details of git add/staging workflow see: > git-scm staging
In simple terms, filter.clean for staging, filter.smudge for checkout


Next
- [ ] multiline for per log functions
- [ ] configurable
- [ ] static parse current line to find out all variables
- [ ] log plugin of webstorm
