Skip to content

Commit

Permalink
add logging for axios
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed Oct 24, 2022
1 parent aacf4be commit 71bca0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@wcpos/app-electron",
"productName": "WooCommerce POS",
"description": "Electron app for WooCommerce POS",
"version": "1.0.0-alpha.56",
"version": "1.0.0-alpha.57",
"private": true,
"author": "kilbot <[email protected]>",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "electron-react-boilerplate",
"productName": "WooCommerce POS",
"version": "1.0.0-alpha.56",
"version": "1.0.0-alpha.57",
"description": "A simple front-end for taking WooCommerce orders at the Point of Sale.",
"license": "MIT",
"author": {
Expand Down
6 changes: 4 additions & 2 deletions src/main/axios.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { ipcMain } from 'electron';
import axios from 'axios';
import https from 'https';
import logger from './log';

// import structuredClone from 'core-js-pure/stable/structured-clone';

/**
Expand Down Expand Up @@ -31,7 +33,7 @@ ipcMain.handle('axios', (event, obj) => {
*/
// const cloned = structuredClone({ ...res, config: null, request: null });
const cloned = { ...res, config: obj.config, request: null };
console.log('success', cloned);
logger.info('success', cloned);
resolve(cloned);
})
.catch((error) => {
Expand All @@ -45,7 +47,7 @@ ipcMain.handle('axios', (event, obj) => {
request: null,
},
};
console.log('failed', cloned);
logger.error('request failed', cloned);
resolve(cloned);
});
});
Expand Down

0 comments on commit 71bca0f

Please sign in to comment.