Improve logging for server SQL requests
This commit is contained in:
@@ -352,12 +352,12 @@ exports.getAllConnections = async (callback = undefined) => {
|
|||||||
|
|
||||||
// Function to run and handle SQL errors
|
// Function to run and handle SQL errors
|
||||||
function runSQL(sqlQuery, callback = undefined, error = (err) => {
|
function runSQL(sqlQuery, callback = undefined, error = (err) => {
|
||||||
console.log(err);
|
log.ERROR(err);
|
||||||
throw err;
|
throw err;
|
||||||
}) {
|
}) {
|
||||||
connection.query(sqlQuery, (err, rows) => {
|
connection.query(sqlQuery, (err, rows) => {
|
||||||
if (err) return error(err);
|
if (err) return error(err);
|
||||||
//console.log('The rows are:', rows);
|
log.VERBOSE('Response for query: ', sqlQuery, rows);
|
||||||
return (callback) ? callback(rows) : rows
|
return (callback) ? callback(rows) : rows
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user