mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-18 12:40:41 +01:00
fix: issue with logger on import/export
This commit is contained in:
parent
eafdb1cc3d
commit
cb038b374a
@ -7,8 +7,10 @@ import SSH2Promise from 'ssh2-promise';
|
|||||||
const queryLogger = ({ sql, cUid }: {sql: string; cUid: string}) => {
|
const queryLogger = ({ sql, cUid }: {sql: string; cUid: string}) => {
|
||||||
// Remove comments, newlines and multiple spaces
|
// Remove comments, newlines and multiple spaces
|
||||||
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);
|
if (webContents) {
|
||||||
mainWindow.send('query-log', { cUid, sql: escapedSql, date: new Date() });
|
const mainWindow = webContents.fromId(1);
|
||||||
|
mainWindow.send('query-log', { cUid, sql: escapedSql, date: new Date() });
|
||||||
|
}
|
||||||
if (process.env.NODE_ENV === 'development') console.log(escapedSql);
|
if (process.env.NODE_ENV === 'development') console.log(escapedSql);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user