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

logging WHERE column LIKE '%s%' is not possible when passing meta #1008

Open
q42jaap opened this issue Apr 12, 2017 · 1 comment
Open

logging WHERE column LIKE '%s%' is not possible when passing meta #1008

q42jaap opened this issue Apr 12, 2017 · 1 comment

Comments

@q42jaap
Copy link

q42jaap commented Apr 12, 2017

logger.info(`WHERE column LIKE '%s%'`, {sql: true})

will log WHERE column LIKE '[object Object]%'
Escaping the % will

logger.info(`WHERE column LIKE '%%s%%'`, {sql: true})

will log WHERE column LIKE '%%s%%'

It's caused by:
https://github.com/winstonjs/winston/blob/master/lib/winston/logger.js#L181

I tried raising an issue with util.format, but they won't fix a bug that was introduced doing performance work: nodejs/node#12362

@q42jaap
Copy link
Author

q42jaap commented Apr 12, 2017

It's suggested to use npm install printf...

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

No branches or pull requests

1 participant