mirror of https://github.com/Fabio286/antares.git
fix: console events disabled in production
This commit is contained in:
parent
ec75f9546a
commit
0b1aa3dd29
|
@ -9,7 +9,7 @@ const queryLogger = ({ sql, cUid }: {sql: string; cUid: string}) => {
|
||||||
const escapedSql = sql.replace(/(\/\*(.|[\r\n])*?\*\/)|(--(.*|[\r\n]))/gm, '').replace(/\s\s+/g, ' ');
|
const escapedSql = sql.replace(/(\/\*(.|[\r\n])*?\*\/)|(--(.*|[\r\n]))/gm, '').replace(/\s\s+/g, ' ');
|
||||||
const mainWindow = webContents.fromId(1);
|
const mainWindow = webContents.fromId(1);
|
||||||
mainWindow.send('query-log', { cUid, sql: escapedSql, date: new Date() });
|
mainWindow.send('query-log', { cUid, sql: escapedSql, date: new Date() });
|
||||||
console.log(escapedSql);
|
if (process.env.NODE_ENV === 'development') console.log(escapedSql);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1536,7 +1536,7 @@ export class MySQLClient extends AntaresCore {
|
||||||
}
|
}
|
||||||
|
|
||||||
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
||||||
if (process.env.NODE_ENV === 'development') this._logger({ cUid: this._cUid, sql });
|
this._logger({ cUid: this._cUid, sql });
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
nest: false,
|
nest: false,
|
||||||
|
|
|
@ -1314,7 +1314,7 @@ export class PostgreSQLClient extends AntaresCore {
|
||||||
}
|
}
|
||||||
|
|
||||||
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
||||||
if (process.env.NODE_ENV === 'development') this._logger({ cUid: this._cUid, sql });
|
this._logger({ cUid: this._cUid, sql });
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
nest: false,
|
nest: false,
|
||||||
|
|
|
@ -586,7 +586,7 @@ export class SQLiteClient extends AntaresCore {
|
||||||
}
|
}
|
||||||
|
|
||||||
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
||||||
if (process.env.NODE_ENV === 'development') this._logger({ cUid: this._cUid, sql });// TODO: replace BLOB content with a placeholder
|
this._logger({ cUid: this._cUid, sql });// TODO: replace BLOB content with a placeholder
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
nest: false,
|
nest: false,
|
||||||
|
|
Loading…
Reference in New Issue