Knex calling the global console (use of console.log internally)
See original GitHub issueIssue Analytics
- State:
- Created 7 years ago
- Comments:19 (11 by maintainers)
Top Results From Across the Web
Using console log in Knex migration not logging
Migrated Migration Done. These logs come from our migration script where we call database.migrate.latest(). My expected terminal output for the ...
Read more >Installation | Knex.js
Knex can be used as an SQL query builder in both Node.JS and the browser, limited to WebSQL's constraints (like the inability to...
Read more >Solving 14 SQL Exercises with Knex.JS - Ynon Perek
select('*'); console.log(users); knex.destroy(); } main();. Calling destroy at the end closes all connections to the database and ...
Read more >Building a RESTful API with Koa and Postgres - Michael Herman
const server = app.listen(PORT, () => { console.log(`Server listening on ... Install Knex globally as well so you can use the CLI tool:....
Read more >Tutorial: Setting up Node.js with a database - Medium
In this tutorial, I will show how to setup MySQL with Node using Knex in order to create a crude ... Check your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tgriesser I see you made a commit which adds
setLogger
, will it be merged soon or is there something blocking it?Yeah, the most reasonable thing to do would be to inject an alternative logger when building a knex instance
eg:
const logger = require('bunyan').createLogger({}) const knex = Knex({client: 'x', connection: {}, logger: logger)
where logger defaults to console, if a logger is assigned I think the default behavior should be to log all events and let the logger figure out the log level. it’ll be quite messy if it’ll requires passing .debug(true) to every query. I can write a patch for that if you’d like.