tracer icon indicating copy to clipboard operation
tracer copied to clipboard

No way of appending custom transport while keeping default transport

Open broofa opened this issue 5 years ago • 1 comments

I'd like to retain the default transport behavior (console.log), while adding a custom transport (to route errors to Sentry). Currently there's no simple way of doing this. You have to copy paste the code for the existing transport into the transport config array.

Maybe expose the default transport as exports.DEFAULT_TRANSPORT, to allow for code like this:

const tracer = require('tracer');

tracer.console({
  transport: [
    tracer.DEFAULT_TRANSPORT,
    data => {
      // ... custom transport logic
    }
  ]
})

I can take a stab at a PR if you think this is worth doing.

broofa avatar Jan 31 '20 04:01 broofa

I think the default transport behavior is only console.log, no more complex

baryon avatar May 14 '20 03:05 baryon

[Closing out issues I authored that appear to be stagnant.]

broofa avatar Apr 03 '23 17:04 broofa