Commit 70f24fcd authored by Tristan A Spakes's avatar Tristan A Spakes

Logging of app closure refined

parent b1f89e7b
Pipeline #23383 canceled with stages
in 57 seconds
......@@ -378,14 +378,7 @@ ipcMain.on('log', (event, message, level) => {
})
ipcMain.on('close app', () => {
try {
execSync(`echo 'ORNLToolbox: Toolbox closed' | logger -p local0.info`)
} catch(error) {
console.error(error)
return
}
app.quit()
exit()
})
app.on('ready', createWindow)
......@@ -399,3 +392,12 @@ app.on('activate', () => {
createWindow()
}
})
app.on('will-quit', () => {
try {
execSync(`echo 'ORNL Toolbox: Toolbox closed' | logger -p local0.info`)
} catch(error) {
console.error(error)
return
}
})
......@@ -57,11 +57,11 @@ function addUser() {
} catch(error) {
error = error.toString()
if(error.includes('already exists')) {
ipcRenderer.send('log', `ORNL Toolbox: ${uid} already exists as a user`, 'err')
ipcRenderer.send('log', `ORNL Toolbox: Add User reuest failed - ${uid} already exists as a user`, 'err')
alert('User already exists')
return
} else if(error.includes('Request dismissed')) {
ipcRenderer.send('log', 'ORNL Toolbox: Add User canceled', 'info')
ipcRenderer.send('log', 'ORNL Toolbox: Add User request canceled', 'info')
alert('Operation canceled')
return
}
......
......@@ -34,11 +34,11 @@ function removeUser() {
} catch(error) {
error = error.toString()
if(error.includes('does not exist')) {
ipcRenderer.send('log', `ORNL Toolbox: ${uid} does not exist as a user`, 'err')
ipcRenderer.send('log', `ORNL Toolbox: Remove User request failed - ${uid} does not exist as a user`, 'err')
alert('User does not exist')
return
} else if(error.includes('Request dismissed')) {
ipcRenderer.send('log', 'ORNL Toolbox: Remove User canceled', 'info')
ipcRenderer.send('log', 'ORNL Toolbox: Remove User request canceled', 'info')
alert('Operation canceled')
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment