Reroute logging of an npm package that uses debug to a different logging function
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- observability
Research direction
Start by reading the debug package's public logging behavior and the linked socket.io issue #4482, including the described attempts to redirect output. Determine whether an external logging hook can be supported; done means establishing a clear, documented way to send debug output somewhere other than console.log.
Written by the indexing model from the issue text.
Description
I am using socket.io, which in turn uses debug for its logging needs. While it's nice that that means I can easily turn on/off logging via an environment variable, I am a bit stumped on how to get it to log to anywhere else but console.log. I am describing my use case (and what I tried and failed to do) here: https://github.com/socketio/socket.io/issues/4482
While this might in the end be a problem that has to somehow be solved in the socket.io package, I wanted to ask here too, in case there is any easy way to do this myself from the outside.
- Dominant language
- JavaScript
- Stars
- 11.5k
- Forks
- 992
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from debug-js/debug
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Debug as JSON Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 28/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·