Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dont-care-log

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dont-care-log

teach git stage/diff how to ignore specific logging code

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

dont-care-log

Build Status NPM Version NPM Downloads Node.js LICENSE

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-log

and 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

filter-clean

filter-smudge

Next

  • multiline for per log functions
  • configurable
  • static parse current line to find out all variables
  • log plugin of webstorm

License

MIT LICENSE

Keywords

FAQs

Package last updated on 03 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc