Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different formatting for namespaces on TTY and files #946

Open
fgeorges opened this issue Oct 16, 2023 · 0 comments
Open

Different formatting for namespaces on TTY and files #946

fgeorges opened this issue Oct 16, 2023 · 0 comments

Comments

@fgeorges
Copy link

fgeorges commented Oct 16, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant