Different formatting for namespaces on TTY and files
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- tooling
Research direction
No files or tests are identified in the issue. Start by locating the formatting path used when debug.log is overridden and compare it with the stderr path. Done means each instance can choose whether to emit ANSI escape sequences and ISO datetimes independently.
Written by the indexing model from the issue text.
Description
It is possible to redirect the output of some namespaces to files (by assigning a function to debug.log), whilst maintaining others to stderr (by keeping debug.log undefined.)
But all lines are formatted the same way. If stderr is a TTY, they all get colours (using ANSI escape sequences), even in files, and no ISO datetime at the beginning. If stderr is not a TTY (e.g. using 2>&1 | cat) then colours are removed everywhere, even on stderr, and an ISO datetime is prepended to each line.
Is it possible to chose the formatting on a per-instance basis? That is, when I override debug.log, I would like to remove ANSI escape sequences, and add the ISO datetimes.
- 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 ·