mirror of https://github.com/Fabio286/antares.git
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}) => {
|
||||
// Remove comments, newlines and multiple spaces
|
||||
const escapedSql = sql.replace(/(\/\*(.|[\r\n])*?\*\/)|(--(.*|[\r\n]))/gm, '').replace(/\s\s+/g, ' ');
|
||||
const mainWindow = webContents.fromId(1);
|
||||
mainWindow.send('query-log', { cUid, sql: escapedSql, date: new Date() });
|
||||
if (webContents) {
|
||||
const mainWindow = webContents.fromId(1);
|
||||
mainWindow.send('query-log', { cUid, sql: escapedSql, date: new Date() });
|
||||
}
|
||||
if (process.env.NODE_ENV === 'development') console.log(escapedSql);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue