question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RFC] Compatibility layer

See original GitHub issue

One problem we’re going to be facing, now that I’m thinking about it:

We will be introducing the ability to specify a custom output format with #582.

This new output support (the env-var support) won’t be available for older versions, which means debug will now be showing different output formats for old versions of the library, which is a problem since debug is almost as old as node.js IIRC.

That means users that set DEBUG_FORMAT will see inconsistent output formats for code that is any older than the new major version release.


Should there be a compatibility layer introduced in the newest version that sniffs out older versions of debug and patches them up, being version-aware in terms of the API?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
sindresorhuscommented, Dec 15, 2018

I don’t think it’s feasible to backport to all old versions. Some packages might even have the dependency locked to a specific debug version too, so it would not work then. And if you can’t reliably do for all situations, is there really any point.

This would be a good time to come up with some way to monkeypatch that would let you introduce other flags and changes in the future too. Maybe by making all the debug() instances minimal with a well defined transport that will never change and have the core as a singleton that mediates those minimal instances, where it uses the newest registered core. Since the latest version always becomes the singleton, it knows how to handle all older versions.

1reaction
Qix-commented, Dec 16, 2018

Well if we monkey patch then maybe we can funnel into a log handler, which can then be plugged into optionally by node -r. Then we could have a json log consumer and not have to deal with those formatters (cc @chagris).

Best of both worlds.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[RFC] back on nf_tables (plus compatibility layer) - LWN.net
Hi, I've been working for a while to recover nf_tables kernel patches and to implement a compatibility layer so it can be used...
Read more >
Re: [Quilt-dev] [RFC] compatibility layer - GNU mailing lists
Subject: Re: [Quilt-dev] [RFC] compatibility layer ... For the compatibility symlinks, you redefine the FOO variables in Makefile > (e.g., BASH).
Read more >
IPv6 Enterprise Network Analysis - IP Layer 3 Focus RFC 4852
Abstract This document analyzes the transition to IPv6 in enterprise networks focusing on IP Layer 3. These networks are characterized as having multiple ......
Read more >
RFC 6101: The Secure Sockets Layer (SSL) Protocol Version ...
This document specifies version 3.0 of the Secure Sockets Layer (SSL 3.0) ... RFC 6101 The SSL Protocol Version 3.0 August 2011 Forward...
Read more >
Re: [RFC] back on nf_tables (plus compatibility layer) - Jan Engelhardt
... Linux Networking Developer Mailing List <netdev@vger.kernel.org> Subject: Re: [RFC] back on nf_tables (plus compatibility layer) Date: Wed, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found