Skip to content

Customizing output format #582

Open
@Qix-

Description

@Qix-

Ref #573, #565, #553, #456, #453, #402, #578, #526, #525, #488

Right now it's very clear that debug takes a subjective stance on its output format. This is unsuitable for a variety of use-cases, especially the disparity between the isatty(2) == 0 and == 1 cases.

Let's figure out how to solve this.


My initial knee-jerk idea would be to introduce a DEBUG_FORMAT environment 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

DEBUG_FORMAT="%N %m %D"

Where %N is the namespace (colored if interactive terminal), %m is the message and %D is 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.

Metadata

Metadata

Labels

change-majorThis proposes or provides a change that requires a major releasediscussionThis issue is requesting comments and discussionfeatureThis proposes or provides a feature or enhancementhelp-wantedThis issue has an actionable itempr-welcomeThis issue has an approved change; a pull request would be appreciated

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions