You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think a great addition to this package would be the ability to map the logs to an external function
For example I used to use bettersqlite3 and this allowed you to pass a function when you setup the connection that will get called with the value of the logs. Options could include levels of logging such as errors, information or even as deep as debug which would log every single sql query run.
I dearly miss this feature when using mariadb.
Very rough example usage
constmyLogger={debug(msg){console.log(`${newDate().toLocaleString()}${msg} }, error(msg) { console.log(`ERROR: ${newDate().toLocaleString()} ${msg}},}constconn=awaitmariadb.createConnection({host: "192.168.1.1",user: "user",password: "password",logger: {verbose: myLogger.debug// the raw sql of all sql querieserror: myLogger.error// all errors}});
The text was updated successfully, but these errors were encountered:
I think a great addition to this package would be the ability to map the logs to an external function
For example I used to use
bettersqlite3and this allowed you to pass a function when you setup the connection that will get called with the value of the logs. Options could include levels of logging such as errors, information or even as deep as debug which would log every single sql query run.I dearly miss this feature when using mariadb.
Very rough example usage
The text was updated successfully, but these errors were encountered: