Way to disable printf-style feature temporarily

Abierto
#976 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
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript
Área
tooling

Línea de trabajo

Start with the printf-style formatter described in the README's Formatters section and trace how debug log arguments are processed. Reproduce the LIKE example and evaluate the requested per-call opt-out against the existing logging API. Done means a supported way to keep percent-prefixed SQL text literal without breaking current printf formatting.

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

Descripción

We are seeing some interesting side-effect of the printf-style feature outlined here: https://github.com/sequelize/sequelize/issues/17448

Long story short, we are using debug to print SQL queries that are executed against database servers and whenever people use a like or ilike query in combination with % at the beginning, it sometimes happens that the logs show NaN. This happens when the search term starts with any of the printf-style characters, e.g. for something like SELECT * FROM foo WHERE name LIKE %fauzi%. The logs will then contain NaNauzi.

Would it be possible to force a debug log statement to ignore any printf formatting?

Something like:

const log = debug('sql')

log("%fauzi%", { printfFormatting: false})
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.