Can't set global `log()` function overriding namespaces ones
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, nodejs
- 领域
- tooling
调研方向
Start by comparing the output-streams documentation with src/common.js around lines 112-113 and the referenced examples/node/stdout.js path. Determine whether the documented precedence and example are consistent, then add or update coverage for the chosen behavior and verify the documentation explains how global and namespace log functions interact.
由索引模型根据 Issue 内容生成。
描述
On the example located at https://github.com/debug-js/debug#output-streams, it shows that's possible to set custom log() functions for each namespace, but also that setting it directly on the debug module takes precedence and will be used instead of the namespace ones. This is specially useful in my use case, since I want to capture Mediasoup debuging Logger and redirect it to Moleculer logger. Problem is that according to https://github.com/debug-js/debug/blob/c0805cc4d3b2c7c987567e99ecaec78840516d7b/src/common.js#L112-L113 namespaces log() function has absolute priority, so it's not possible to do it globally, and it's not possible to directly bind on top of Mediasoup Loggers since they are private, so I'm in an end road.
Since the linken example at https://github.com/debug-js/debug/blob/master/examples/node/stdout.js doesn't exists too, I'm not sure if the documentation is outdated or wrong, or if setting debug.log() should effectively override per-namespace log() function and this is in fact a bug. Besides fixing this one way or another, how can I solve my problem of redirect Mediasoup log messages to Moleculer?
- 主要语言
- JavaScript
- 星标
- 11.5k
- 派生
- 992
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
debug-js/debug 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
Debug as JSON 未关闭
难度 5/5 一周以上 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 28/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 78/100
Automattic/studio#4908 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 86/100
sugarlabs/musicblocks#8847 ·