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

Way to disable printf-style feature temporarily #976

Open
sdepold opened this issue Nov 9, 2024 · 0 comments
Open

Way to disable printf-style feature temporarily #976

sdepold opened this issue Nov 9, 2024 · 0 comments

Comments

@sdepold
Copy link

sdepold commented Nov 9, 2024

We are seeing some interesting side-effect of the printf-style feature outlined here: sequelize/sequelize#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})
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