Different formatting for namespaces on TTY and files

Abierto
#946 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript
Área
tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
JavaScript
Estrellas
11.5k
Forks
992
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de debug-js/debug

Todos los issues de debug-js/debug

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.