-
Notifications
You must be signed in to change notification settings - Fork 969
Customizing output format #582
Copy link
Copy link
Open
Labels
change-majorThis proposes or provides a change that requires a major releaseThis proposes or provides a change that requires a major releasediscussionThis issue is requesting comments and discussionThis issue is requesting comments and discussionfeatureThis proposes or provides a feature or enhancementThis proposes or provides a feature or enhancementhelp-wantedThis issue has an actionable itemThis issue has an actionable itempr-welcomeThis issue has an approved change; a pull request would be appreciatedThis issue has an approved change; a pull request would be appreciated
Milestone
Metadata
Metadata
Assignees
Labels
change-majorThis proposes or provides a change that requires a major releaseThis proposes or provides a change that requires a major releasediscussionThis issue is requesting comments and discussionThis issue is requesting comments and discussionfeatureThis proposes or provides a feature or enhancementThis proposes or provides a feature or enhancementhelp-wantedThis issue has an actionable itemThis issue has an actionable itempr-welcomeThis issue has an approved change; a pull request would be appreciatedThis issue has an approved change; a pull request would be appreciated
Ref #573, #565, #553, #456, #453, #402, #578, #526, #525, #488
Right now it's very clear that
debugtakes a subjective stance on its output format. This is unsuitable for a variety of use-cases, especially the disparity between theisatty(2) == 0and== 1cases.Let's figure out how to solve this.
My initial knee-jerk idea would be to introduce a
DEBUG_FORMATenvironment variable. It would accept a string with delimiters similar to date-time or printf formats that indicate different elements of a debug log.This would also remove the need for a plethora of custom environment variables that have been proposed.
We'd have a default format that would then be the same between interactive/non-interactive TTY sessions (fd 2, as always).
This would look something like
Where
%Nis the namespace (colored if interactive terminal),%mis the message and%Dis the time diff - the exact format in the screenshot in the readme.Of course there would be other delimiters available, and the above doesn't necessarily need to be the default, but it would solve pretty much any use-case imaginable regarding the output format in a non-subjective manner.
That's just my personal proposal, but this RFC is after any solution, so if you have a different idea please sound off below.