优化日志打印
parent
d81cba0b7a
commit
1a7dd811dd
|
@ -61,7 +61,7 @@ class Api {
|
||||||
let defer = Promise.defer()
|
let defer = Promise.defer()
|
||||||
|
|
||||||
if (this.debug) {
|
if (this.debug) {
|
||||||
console.log('[debug]', sql)
|
console.log(`[${new Date().format('Y/m/d_H:i:s')}][debug]`, sql)
|
||||||
}
|
}
|
||||||
|
|
||||||
conn.query(sql, (err, result) => {
|
conn.query(sql, (err, result) => {
|
||||||
|
|
|
@ -30,7 +30,7 @@ class Method {
|
||||||
return this._connect().then(conn => {
|
return this._connect().then(conn => {
|
||||||
let defer = Promise.defer()
|
let defer = Promise.defer()
|
||||||
if (this.debug) {
|
if (this.debug) {
|
||||||
console.log('[debug]', sql)
|
console.log(`[${new Date().format('Y/m/d_H:i:s')}][debug]`, sql)
|
||||||
}
|
}
|
||||||
conn.query(sql, (err, result) => {
|
conn.query(sql, (err, result) => {
|
||||||
conn.release()
|
conn.release()
|
||||||
|
|
|
@ -299,7 +299,7 @@ class SqlErr {
|
||||||
hideProperty(this, 'stack', msg)
|
hideProperty(this, 'stack', msg)
|
||||||
console.error(
|
console.error(
|
||||||
'-'.repeat(50),
|
'-'.repeat(50),
|
||||||
'[Last Query SQL]: ' + sql,
|
`[${new Date().format('Y/m/d_H:i:s')}][Last Query SQL]: ${sql}`,
|
||||||
`Query ${msg}`,
|
`Query ${msg}`,
|
||||||
'-'.repeat(50)
|
'-'.repeat(50)
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mysqli",
|
"name": "mysqli",
|
||||||
"version": "3.1.1",
|
"version": "3.1.2",
|
||||||
"description": "MySQL tool",
|
"description": "MySQL tool",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
Loading…
Reference in New Issue