Closed nodesocket closed 7 years ago
The same way. Options are directly pass to rethinkdbdash.
For others that are trying to get this working, here is the solution I came up with:
const thinky = require('thinky')({
r: require('rethinkdbdash')(Object.assign(config.rethinkdb, {
silent: true,
log: (message) => {
console.log(`custom logger => ${message}`);
}
}))
});
config.rethinkdb
is your existing config object that you previously were passing into Thinky.
This is the easiest way to do it:
var thinky = require('thinky')({
silent: true,
log: function(message) {
console.log(message);
}
});
This does work, not sure what I was doing wrong previously. Thanks.
const thinky = require('thinky')(
_.extend(config.rethinkdb, {
silent: true,
log: (message) => {
console.log(`custom logger => ${message}`);
}
})
);
How can I define my own
log
function and setsilent: true
for the underlying rethinkdbdash connection? In the documentation for rethinkdbdash it says to set the following:How is this done using thinky?