caiogondim / logdown.js

:pencil2: Debug utility with markdown support that runs on browser and server
http://caiogondim.github.io/logdown.js/
MIT License
1.02k stars 37 forks source link

Thoughts about v4 #228

Open caiogondim opened 4 years ago

caiogondim commented 4 years ago

Let's discuss here about possible features for a v4.

Interceptors

Implement the interceptor pattern so the lib is more extensible.

const logger = logdown('foo;)

const silenceLorem = ({ instance, methodName, args }) => {
  if (args[0] === 'lorem') return
  return { instance, methodName, args }
}

logger.log('lorem') // prints 'lorem'
looger.interceptors.inject(silenceLorem)
logger.log('lorem') // doesnt print 'lorem'
logger.interceptors.eject(silenceLorem)
logger.log('lorem') // prints 'lorem'

Deprecate transports

We could use interceptors which is a more generic API.

TypeScript

I'm now on board of the TS hype train.

Drop IE11 support

It's finally time.

jcheenatcode commented 4 years ago

This library is really concise & does its work very, so I though I'll share my thoughts I had for this topic,

Will be willing to contribute, if needed.

Thanks